Support the ongoing development of Laravel.io →
Eloquent Views Blade
Last updated 2 years ago.
0

What is your primary key column name on page table? Eloquent assume that each table has a primary key column named "id". Did you overwrite it in your model?

Last updated 2 years ago.
0

primary key is id INT(11) Auto Inc,

Page model:

<?php class Page extends Eloquent { /** * The database table used by the model. * * @var string */ protected $table = 'pages'; public function section() { return $this->hasMany('Section'); } public function carousel() { return $this->hasMany('Carousel'); } }
Last updated 2 years ago.
0

Then why the query is using page_id as primary? Hmm.. It is late here in czech republic... I dont see where may be the problem here... :/

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.