You can use laravel arrow function in routing, without having to use anonymous function.
To do this, you can use fn() => arrow function
// Instead of
Route::get('/route_name', function () {
return User::all();
});
// You can
Route::get('/route_name', fn () =>User::all());
No comments:
Post a Comment