LARAVEL Routing MCQLaravel MCQ
(1) Which of the following route can be used to catch all http requests in place of 404.
Route::fallback is a type of dynamic route, that can be used to catch every http request. In case of no one route matched. By default these requests are direct to 404 by Laravel default exception handling.
(2) In Laravel which of the following route is used to match all HTTP verbs?
Route::any is used to match all HTTP verbs for particular URI. This route is helpful where we are required to implement multiple http requests against single URI. Alternatively we can also use Route::match but here we will have to provide names of all HTTP verbs as array.
(3) Which of the following dynamic route is used to specify more than one HTTP verbs in a single route ?
Route::match route is used to match multiple HTTP requests in a single route. Multiple HTTP verbs can be provided as an array in this route as first parameter. Such as: Route::match(['get','post'], '/URI', 'MyController@controllerMyMethod');
(4) In which of the following HTTP request parameters are displayed in URL?
In get request passed parameters are displayed in URL.
(5) Which of the following HTTP verb is not available in Laravel application?
Cath is not a HTTP verb and this is not available to implement in laravel application. All other available options are valid HTTP verbs.