laravel cudzí kľúč
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();
});
laravel urobiť model s migráciou a regulátorom
php artisan make:model Todo -mcr
vrátenie migrácie
php artisan migrate:rollback
vytvorenie migrácie Laravelu
php artisan make:migration create_users_table
laravel urobiť model a migrácia
php artisan make:model Settings -m
remeselník vykonať migráciu s modelom
php artisan make:Model Status -m