第14课 Eloquent Relationship - Paulyoufu/larvavel51 GitHub Wiki

$table->integer('user_id')->default(1);; php artisan migrate:refresh 数据库会被抹 php artisan make:migration add_user_id_column_to_articles --table=articles php artisan migrate 在路由里设置Auth::loginUsingId(2); id为2的用户 $user=App\User::first();