feat/factory_creation (#1)
Prepping for launch. Reviewed-on: #1 Co-authored-by: Paul Couture <paul@paulcouture.com> Co-committed-by: Paul Couture <paul@paulcouture.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -3,8 +3,34 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\Podcast;
|
||||
use App\Models\Artworks;
|
||||
use App\Models\Episode;
|
||||
|
||||
|
||||
class PodcastController extends Controller
|
||||
{
|
||||
//
|
||||
public function show(Request $request, $slug)
|
||||
{
|
||||
$user = auth()->user();
|
||||
$podcast = Podcast::where('slug', $slug)
|
||||
->where('published', true)
|
||||
->firstOrFail();
|
||||
$episodes = Episode::where('published', true)
|
||||
->whereNotNull('artwork_id')
|
||||
->with('artwork')
|
||||
->with('artworks')
|
||||
->where('podcast_id', $podcast->id)
|
||||
->orderBy('episode_number', 'desc')->paginate(100);
|
||||
$podcasts = Podcast::where('published', true)->with('episodes')->get();
|
||||
return view('podcasts.podcast', [
|
||||
'user' => $user,
|
||||
'pageTitle' => $podcast->name,
|
||||
'podcast' => $podcast,
|
||||
'episodes' => $episodes,
|
||||
'podcasts' => $podcasts,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user