app/Http/Controllers/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::all();
        return view('allposts',compact('posts'));
    }
public function index ( ) { $ posts = Post :: all ( ) ; return view ( 'allposts' , compact ( 'posts' ) ) ; }
Display a listing of the resource.
Display a listing of the resource .
//$posts = DB::table('posts')->get(); //dd($posts);