use IlluminateSupportFacadesDB;
$users = DB::select('select * from users');
foreach ($users as $user) {
echo $user->name;
}
$users = DB::table('users')
->where('votes', '>', 100)
->orWhere(function($query) {
$query->where('name', 'Abigail')
->where('votes', '>', 50);
})
->get();
<?php
Route::get('games', function () {
$games = DB::table('games')->get();
return view('games', ['games' => $games]);
});
//select specified colomns from all users
Employee::get(['name','email','title']);