Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Catalog extends Model
- {
- protected $table = "catalog";
- public function items()
- {
- return $this->belongsToMany('App\Item','catalog_items')->select(['items.id','name'];
- }
- }
- $catalog = Catalog::where('url', '=', $param2)->with('items:items.id,name')->first();
- $catalog->items()->paginate(4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement