Laravel administrator relationship 的问题
看完summer推介后试用了一下laravel administrator , 但出现了一些问题
以下是我 save 时遇到的 error. 这是个 one to many 的 relationship. Collection 有很多 Collection products
collection product 的 schema 长这样
Schema::create('collection_products', function(Blueprint $table){
$table->increments('id');
$table->integer('collection_id')->unsigned()->index();
$table->text('name');
$table->text('description');
$table->text('concept');
$table->text('thumbnail');
$table->text('image');
$table->timestamps();
});
Collection_products.php 的 edit_field 长这样
'collections' => array(
'title' => 'Collection',
'type' => 'relationship',
'name_field' => 'name',
),
我的问题是为什么错误中他说 collections_id 不存在?他不是应该去找 collection_id 才对吗?
推荐文章: