1use Illuminate\Support\Facades\DB;
2
3class UserController extends Controller
4{
5 public function index()
6 {
7 $users = DB::table('users')->select('id','name','email')->get();
8
9 return view('some-view')->with('users', $users);
10 }
11}
12
1$users = DB::table('users')->get();
2foreach($users as $key => $value)
3{
4 //to get each columns value
5 //$value->name
6}