Complete the code to define a route that returns a view named 'welcome'.
Route::get('/', function() { return [1]('welcome'); });
The view function returns a view for the given name, which is how Laravel renders pages.
Complete the code to define a route that calls the 'index' method of 'HomeController'.
Route::get('/home', [[1]::class, 'index']);
Routes can call controller methods by specifying the controller class and method name.
Fix the error in the route definition to correctly map '/profile' to 'UserController@show'.
Route::get('/profile', '[1]@show');
Controller names are case-sensitive and should match the class name exactly.
Fill both blanks to create a route that accepts a 'post' parameter and calls 'show' method.
Route::get('/posts/[1]', [PostController::class, '[2]']);
The route parameter is wrapped in curly braces and the method called is 'show' to display a single post.
Fill all three blanks to define a POST route to 'store' method with middleware 'auth'.
Route::[1]('/posts', [PostController::class, '[2]'])->middleware('[3]');
POST routes use post, the method to save data is store, and auth middleware protects routes for logged-in users.