fix: caching podcasts list

This commit is contained in:
Paul Couture 2023-12-17 15:51:24 -06:00
parent ebdc50a697
commit ae697fbaae

View File

@ -31,7 +31,9 @@ public function index()
->orderBy('episode_id', 'desc')
->orderBy('created_at', 'desc')
->paginate($perPage = 54, $columns = ['*'], $pageName = 'artworks');
$podcasts = Podcast::where('published', true)->with('episodes')->get();
$podcasts = Cache::remember('publishedPodcasts', 30, function() {
return Podcast::where('published', true)->get();
});
return view('explore.artworks', [
'user' => $user,
'pageTitle' => 'Explore',
@ -48,7 +50,9 @@ public function index()
public function create()
{
$user = auth()->user();
$podcasts = Podcast::where('published', true)->with('episodes')->get();
$podcasts = Cache::remember('publishedPodcasts', 30, function() {
return Podcast::where('published', true)->get();
});
return view('artworks.submit', [
'user' => $user,
'pageTitle' => 'Submit New Artwork',
@ -171,6 +175,13 @@ public function destroy(Artwork $artwork)
//
}
public function approve(Artwork $artwork)
{
$user = auth()->user();
$awatingApproval = Artwork::whereNull('approved_by')->with('podcast')->orderBy('created_at', 'asc')->get();
}
public function legacyArtLink(Request $request, $any = null)
{
phpinfo();