4

So I'm using the laravel auth because I wanted to have a registration system on my website.

However because my website is Dutch, I'd like to change the url from localhost:8000/login to localhost:8000/inloggen and the same for register.

Does anyone know if this is possible and how to do this?

I couldn't find anything on Google about this so that's why I'm asking here.

Thanks in advance.

3 Answers 3

6

You could add this in routes/web.php:

Route::get('/inloggen', 'Auth\LoginController@showLoginForm' );
Route::post('/inloggen', 'Auth\LoginController@login');

You can find all Auth::routes here: https://github.com/laravel/framework/blob/5.7/src/Illuminate/Routing/Router.php#L1144

Sign up to request clarification or add additional context in comments.

Comments

3

Just remove Auth::routes(); from your routes/web, And write auth routes manualy.

Here is default auth routes list. enter image description here

You can write your own route for each of them. For example:

Route:post('inloggen', 'Auth\LoginController@login')
Route::get('inloggen', 'Auth\LoginController@showLoginForm')->name('login');
// And other auth routes

Comments

0

You can use aliasing for routes to accomplish this:

Route::get('/inloggen',['as'=>'login','uses'=>'Auth\LoginController@showLoginForm']);

Route::post('/inloggen',['as'=>'login','uses'=>'Auth\LoginController@login']);

4 Comments

as define the name of the route, not the URI. Title is confusing, but @max want to change the URI.
@cbaconnier what is confusion in this?we are just proving alias to the route
It doesn't work like that. This only provide a name to the route that you can use with PHP but it doesn't change the URI or provide an alias to the URL. You can't access to myurl.test/password.request where password.request is the default name of the route.
@cbaconnier I have updated the answer.Please correct if there is any issue yet

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.