Can you provide your model relationships and which data from each model your looking for
Hi RDelorier,
I've a Category and a Listing model
public function children(){
return $this->hasMany('App\Cat','parent_id')->whereStatus(1);
}
public function listings(){
return $this->hasMany('App\Listing')->whereStatus(1);
}
and 4. in Listing model
public function cat(){
return $this->belongsTo('App\Cat');
}
Now, when I'm in category, I want to fetch all featured items all of its sub categories. Home this makes sense.
See ==http://laravel.io/forum/04-04-2015-looping-through-collection. Plus there are Laracast on this.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community