I have 3 tables, Cars, Flats and Shops. Each table has its photos. Photos is stored in database. I want to use only one table for photos, I don\'t want to create Photos table fo
You can treat the relationship objects kind of like queries, in that you can call query building functions with them. The example below should get you going in the right direction.
class Cars extends Eloquent
{
function photos()
{
return $this->hasMany('Photo')->where('photos.type', '=', 'Cars');
}
}