/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function browse(Request $request) { if ($request->has('genre') && ($genre = $this->genres->getAlbumsFor($request->input('genre')))) { return view('frontend.store-browse', ['genre' => $genre]); } return redirect()->route('store::index'); }
/** * Display the specified resource. * * @param string $genrename * @return \Illuminate\Http\Response */ public function show($genrename) { if ($genre = $this->genres->getAlbumsFor($genrename)) { return view('backend.genres.show', compact('genre')); } throw new NotFoundHttpException('url not found'); }
public function compose(View $view) { $view->with('genres', $this->genres->all()); }