app/Http/Controllers/Admin/AdminPostController.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::with('photo', 'category', 'user')->paginate(2);
        return view('admin.posts.index', compact(['posts']));
    }
public function index ( ) { $ posts = Post :: with ( 'photo' , 'category' , 'user' ) -> paginate ( 2 ) ; return view ( 'admin.posts.index' , compact ( [ 'posts' ] ) ) ; }
Display a listing of the resource.
Display a listing of the resource .