/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $post = $this->post->findOrFail($id);
     $post->delete();
     return redirect(route('backend.posts.index'))->withStatus('Post has been deleted');
 }
 /**
  * @param Post $post
  * @param User $user
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function index(Post $post, User $user)
 {
     $posts = $post->latest('updated_at')->take(5)->get();
     $users = $user->whereNotNull('last_login_at')->latest('last_login_at')->take(5)->get();
     return view('backend.dashboard', compact('posts', 'users'));
 }