コード例 #1
0
 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', 'Успешно изтрит блог пост.'));
     }
 }
コード例 #2
0
 public function viewPost($id)
 {
     $blog_post = BlogPosts::findOrFail($id);
     return view('pages.view_blog_post')->with('blog_post', $blog_post);
 }