public function deletePost(Request $request) { if (Auth::user()->email == '*****@*****.**') { BlogPosts::where('id', $request->input('news_id'))->delete(); return redirect()->back()->with($request->session()->flash('admin-success', 'Успешно изтрит блог пост.')); } }
public function viewPost($id) { $blog_post = BlogPosts::findOrFail($id); return view('pages.view_blog_post')->with('blog_post', $blog_post); }