public function index() { $posts = DB::select('SELECT * FROM posts'); return view('posts.index')->with('posts', $posts); }
DB
use DB;
Pro tip: use ```triple backticks around text``` to write in code fences