Level 1
Done..Solved Error !
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!']); }
Please or to participate in this conversation.