user(); $episode = Episode::where('slug', $slug) ->with('approvedArtworks') ->with('artwork') ->with('podcast') ->firstOrFail(); $podcasts = Podcast::where('published', true)->with('episodes', function ($query) { $query->orderBy('episode_number', 'desc'); $query->where('published', true); $query->take(10); })->get(); return view('episodes.episode', [ 'user' => $user, 'pageTitle' => '"' . $episode->title . '" ' . $episode->podcast->name . ' Episode ' . number_format($episode->episode_number + 0), 'podcast' => $episode->podcast, 'episode' => $episode, 'artworks' => $episode->approvedArtworks, 'podcasts' => $podcasts, ]); } /** * Show the form for editing the specified resource. * * @param \App\Models\Episode $episode * @return \Illuminate\Http\Response */ public function edit(Episode $episode) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param \App\Models\Episode $episode * @return \Illuminate\Http\Response */ public function update(Request $request, Episode $episode) { // } /** * Remove the specified resource from storage. * * @param \App\Models\Episode $episode * @return \Illuminate\Http\Response */ public function destroy(Episode $episode) { // } }