/** * Display a listing of the resource. * * @return \Illuminate\View\View */ public function index() { $works = $this->repository->with('tags')->all(); $tags = Tag::with(['posts' => function (BelongsToMany $query) { $query->where('type', 'work'); }])->get(); return view('frontend.pages.works.index', compact('works', 'tags')); }
/** * Display a listing of the resource. * * @return \Illuminate\View\View */ public function index() { $posts = $this->post->with('author')->paginate(5); return view('frontend.pages.blog.index', compact('posts')); }