public function index()
{
    $posts = DB::select('SELECT * FROM posts');
    return view('posts.index')->with('posts', $posts);
}
If we want to use the above query, we have to bring in the
DB
class
use DB;
by Valeri Tandilashvili
4 years ago
Laravel
DB methods
Laravel From Scratch
0
Pro tip: use ```triple backticks around text``` to write in code fences