“Crear tabla laravel” Código de respuesta

llave extranjera de Laravel

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

Crear tabla laravel

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

Laravel crea migración

// 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

Cómo cambiar la migración existente Laravel

php artisan make:migration update_user_guide_in_product_translations_table
Grieving Gaur

migraciones requeridas de campo laravel

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

Crear tabla 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

Respuestas similares a “Crear tabla laravel”

Preguntas similares a “Crear tabla laravel”

Más respuestas relacionadas con “Crear tabla laravel” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código