/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // $posts = DB::table('posts')->get(); $posts = Post::all(); return view('posts.index', compact('posts')); }
public function listPost() { $posts = Post::all(); return $posts; }