fix: tweaking recovery after db corruption
This commit is contained in:
@@ -190,11 +190,12 @@ class ArtworkController extends Controller
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
$user = auth()->user();
|
||||
$artwork = Artwork::where('id', $id)
|
||||
->with('podcast')
|
||||
->with('episode')
|
||||
->with('artist')
|
||||
->first();
|
||||
$artwork = Artwork::with(['podcast', 'episode', 'artist'])->find($id);
|
||||
|
||||
if (!$artwork) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
if (is_null($artwork->approved_by) && $user && $user->id != $artwork->id) {
|
||||
return redirect('artworks');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user