app/Http/Controllers/Dashboard/PostController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
    {
        $posts = Post::paginate(5);
        $total_row = Post::all()->count();
        return  view('posts/index', compact('posts','total_row'));
    }
public function index ( ) { $ posts = Post :: paginate ( 5 ) ; $ total_row = Post :: all ( ) -> count ( ) ; return view ( 'posts/index' , compact ( 'posts' , 'total_row' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .