Function: The user accesses the specified page when the URL is matched to the executed controller or anonymous function! The default Laravel all routes exist in the app/http/routes.php file.
Schematic diagram:
The underlying routes are:
Route::get ($uri, $callback);
Route::p ost ($uri, $callback);
Route::p ut ($uri, $callback);
Route::p atch ($uri, $callback);
Route::d elete ($uri, $callback);
Route::options ($uri, $callback);
Route::match ([' Get ', ' post '], $callback);
Route::any (' foo ', $callback);
Note: Routes cannot contain-characters, and you can use _ instead if needed.
Optional Parameters:
Can be added by parameter? tag to implement, in which case you need to specify a default value of NULL or 0 for the variable in the callback function.
Note: When multiple parameters are used, the last one is optional and, if previously optional, may cause the subsequent directory to move forward. Causes an error.
Routing-7th episode