how i change default url ('/') to ('home/landing/page')

dwiky aliansyah

How can i change default routes ('/') to ('home/landing/page') ? i change in Authenticate but it's doesn't work.

in Authenticate and this eror enter image description here

James

First you need to add a route to your routes.php file or your web.php file depending on what version of Laravel you are using. It should look something like this:

Route::get('home/landing/page', 'SomeController@function`);

Obviously replacing SomeController@function for your controller and the appropriate function. This is why you're currently getting an error as no route is setup.

Next you might want to update your AuthController.php to include:

private $redirectTo = 'home/landing/page';

This ensures that after users login they are redirected to the right page.

Lastly, you may want to redirect any requests to / to redirect to the new page home/landing/page. You can do this in your routes, a controller or with middleware, the choice is yours. Here is a demo doing it in the routes file:

Route::get('/', function () {
    return redirect('home/landing/page');
});

With all the above, and your auth middleware redirecting users to home/landing/page, you should have covered all bases for when users will hit your / route.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related