Birmingham mumbai


Download 1.3 Mb.
Pdf ko'rish
bet63/68
Sana05.01.2022
Hajmi1.3 Mb.
#227543
1   ...   60   61   62   63   64   65   66   67   68
Bog'liq
Laravel 5 Essentials

[

 32 

]

Laravel offers the following methods for defining migrations:



Command

Description

$table->bigIncrements('name');

It creates an auto-incrementing big integer 

column

$table->bigInteger('name');

It creates a BIGINT column



$table->binary('name');

It creates a BLOB column



$table->boolean('active');

It creates a BOOLEAN column



$table->char('name', 8);

It creates a CHAR column with the given length



$table->date('birthdate');

It creates a DATE column



$table->dateTime('created_at');

It creates a DATETIME column



$table->decimal('amount', 5, 

2);

It creates a DECIMAL column with the given 

precision and scale

$table->double('column', 10, 

5);

It creates a DOUBLE column, with 10 digits in 

total and 5 after the decimal point

$table->enum('gender', 

['Female', 'Male']);

It creates an ENUM column



$table->float('amount');

It creates a FLOAT column



$table->increments('id');

It creates an auto-incrementing integer column



$table->integer('rating');

It creates an INTEGER column



$table->json('options');

It creates a JSON column



$table->longText('description');

It creates a LONGTEXT column



$table->mediumInteger('name');

It creates a MEDIUMINT column



$table->mediumText('name');

It creates a MEDIUMTEXT column



$table->morphs('taggable');

It creates two columns: INTEGER taggable_

id

 and STRING taggable_type




Download 1.3 Mb.

Do'stlaringiz bilan baham:
1   ...   60   61   62   63   64   65   66   67   68




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling