“Crie a tabela Laravel” Respostas de código

Laravel Key estrangeiro

Schema::table('posts', function (Blueprint $table) {
    $table->unsignedBigInteger('user_id');

    $table->foreign('user_id')->references('id')->on('users');
});
OR
Schema::table('posts', function (Blueprint $table) {
    $table->foreignId('user_id')->constrained();
});
Courageous Cod

Crie a tabela Laravel

php artisan make:migration create_table_name --create=tablel_name
php artisan migrate  
Snippets

Laravel Crie migração

// use the make:migration Artisan command to generate a database migration
php artisan make:migration create_flights_table

// use --create to indicate whether the migration will be creating a new table
php artisan make:migration create_flights_table --create=flights

// use --table to indicate the table name
php artisan make:migration add_destination_to_flights_table --table=flights
Yingfufu

Como mudar a migração existente Laravel

php artisan make:migration update_user_guide_in_product_translations_table
Grieving Gaur

migrações necessárias em campo Laravel

$table->string('foo')->nullable(false)->change();
r00ster

Crie a tabela Laravel

php artisan make:migration create_employeeDetails_table --create=Employee
//goto create_employeeDetails_table file and add fields in table
php artisan migrate  
MR. D

Respostas semelhantes a “Crie a tabela Laravel”

Perguntas semelhantes a “Crie a tabela Laravel”

Mais respostas relacionadas para “Crie a tabela Laravel” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código