migração laravel chave externa 5.6
Schema::table('posts', function (Blueprint $table) {
$table->unsignedInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
});
adicionar uma coluna na migração de laravel
php artisan make:migration add_paid_to_users_table --table=users
como alterar a migração existente laravel
php artisan make:migration update_user_guide_in_product_translations_table
criar a migração laravel
php artisan make:migration create_users_table
rollback da última migração de laravel
php artisan migrate:rollback --step=1
laravel criar migração
php artisan make:migration add_votes_to_users_table --table=users
php artisan make:migration create_users_table --create=users