I'm trying to get rings from the database. but only filter is the homepage is 1 or 0.
I only need the rows where homepage is 1.
This is what i tried
$ringen = RingKoppelCategory::with('ringen')->get()->where('homepage', '=' , 1);
returns null
And when i put the ->get() at the end of the query builder it checks the ringkoppelcategory table for a homepage which is not what i want it to do.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'homepage' in 'where clause' (SQL: select * from `ringkoppelcategory` where `homepage` = 1
I need to get the rings relationship from the ringkoppelcategory, but only the rings where the homepage is 1.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire