外键约束 $table->foreign('project_id')->references('id')->on('projects')->onDelete('cascade');

 

$table->foreign('project_id')->references('id')->on('projects')->onDelete('cascade');

 

验证规则:exists:projects,id

'project_id' => 'required|integer|exists:projects,id'

 

posted @ 2019-07-21 23:20  hakeer  阅读(159)  评论(0编辑  收藏  举报