Answer the question
In order to leave comments, you need to log in
How to change the path to authorization in laravel and at the same time pass a parameter?
Good afternoon.
I just started learning the Laravel framework and ran into a problem, the answer to which I have not found anywhere yet. Couldn't decide on my own. Please help me figure it out.
Version
Laravel Framework 6.10.1
Task
Change the path to the authorization pages and add a parameter to the address.
Description
After executing commands
Auth::routes();
// Login
Route::group(['middleware' => ['web']], function() {
Route::get('/en/login', ['as' => 'login', 'uses' => 'Auth\[email protected]']);
Route::post('/en/login', ['as' => 'login.post', 'uses' => 'Auth\[email protected]']);
Route::post('/en/logout', ['as' => 'logout', 'uses' => 'Auth\[email protected]']);
});
// Registration Routes...
Route::get('register', ['as' => 'register', 'uses' => 'Auth\[email protected]']);
Route::post('register', ['as' => 'register.post', 'uses' => 'Auth\[email protected]']);
// Password Reset Routes...
Route::get('password/reset', ['as' => 'password.reset', 'uses' => 'Auth\[email protected]']);
Route::post('password/email', ['as' => 'password.email', 'uses' => 'Auth\[email protected]']);
Route::get('password/reset/{token}', ['as' => 'password.reset.token', 'uses' => 'Auth\[email protected]']);
Route::post('password/reset', ['as' => 'password.reset.post', 'uses' => 'Auth\[email protected]']);
[15:19:24] LOG.error: Missing required parameters for [Route: login] [URI: {url_lang}/login]. (View: C:\xampp\htdocs\laravel\poligon.local\resources\views\layouts\app.blade.php) {"exception":{}}
Answer the question
In order to leave comments, you need to log in
For the described task, I was completely satisfied with the solution shown in this video: https://youtu.be/_BsHyHc9NqE
In addition, some more changes need to be made. You can see more in this thread:
How to get rid of the Missing required paramete...
Go to app.blade.php and find the line there with a link to the login page, it's most likely just written somewhere.
You need to add the necessary parameter there.{{route('login')}}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question