how to get data from a table in laravel
snippet in php

how to get data from a table in laravel

user3774

use Illuminate\Support\Facades\DB;

class UserController extends Controller
{
    public function index()
    {
        $users = DB::table('users')->select('id','name','email')->get();

        return view('some-view')->with('users', $users);
    }
}

DB::table('users')->get();

user1039

$users = DB::table('users')->get();