diff --git a/site/app/Http/Controllers/ArtworkController.php b/site/app/Http/Controllers/ArtworkController.php index 4fb14b6..0f77003 100644 --- a/site/app/Http/Controllers/ArtworkController.php +++ b/site/app/Http/Controllers/ArtworkController.php @@ -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();