Laravel - Basics and Architecture
Which syntax correctly shows how to define a route in Laravel using a closure?
Route::get('/home', function () { return 'Home'; }); uses correct syntax with a closure function. route->get('/home', function () { return 'Home'; }); uses wrong arrow syntax. Route.get('/home', () => 'Home'); uses dot notation which is invalid. Route::get('/home', 'HomeController@index'); is valid Laravel syntax but requires a controller method, not a closure.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions