Prachee's avatar

Error Class 'App\Http\Controllers\Auth' not found http://localhost/Laravel/public/delete-post/4

Laravel Version 7.20 Function in PostController.

public function getDeletePost($post_id) { $post = Post::where('id', $post_id)->first(); if(Auth::user() != $post->user){ return redirect()->back(); } $post->delete(); return redirect()->route('dashboard')->with(['message' => 'Successfully Deleted!']); }

0 likes
1 reply

Please or to participate in this conversation.