August 9, 2021 in Laravel, Technology, Tips and Tricks
Available Column Types in Laravel
Command Description $table->id(); Alias of $table->bigIncrements(‘id’). $table->foreignId(‘user_id’); Alias of $table->unsignedBigInteger(‘user_id’). $table->bigIncrements(‘id’); Auto-incrementing UNSIGNED BIGINT (primary key) equivalent column. $table->bigInteger(‘votes’); BIGINT equivalent column. $table->binary(‘data’); BLOB equivalent column. $table->boolean(‘confirmed’); BOOLEAN equivalent column. $table->char(‘name’, 100); CHAR equivalent column with a length. $table->date(‘created_at’); DATE equivalent column. $table->dateTime(‘created_at’, 0); DATETIME equivalent column with precision (total digits). $table->dateTimeTz(‘created_at’, 0); DATETIME (with timezone) equivalent […]