execute query sql in laravel code example
Example 1: laravel sql query
use Illuminate\Support\Facades\DB;
$users = DB::select('select * from users');
foreach ($users as $user) {
echo $user->name;
}
Example 2: Writing into the database with one click laravel
Route::post('/signup', [
'as' => 'signup',
'uses' => 'YourController@manuelSignUP',
]);