0

It seems straightforward as mentioned in the documentation here

but for some reason changing the value of the constant HOME refuses to work. I changed

public const HOME = '/dashboard';

to

public const HOME = '/newhome';

but it still lands on /dashboard after login. I have rechecked the declaration of the routes, cleared the routes cache using php artisan optimize but it simply does not work.

I have worked the way around by using Route::get('/dashboard', function () { return view('newhome'); })->name('dashboard'); but don't like it as it feels janky.

Am I missing something here?

burf
  • 153
  • 2
  • 8
  • ``php artisan optimize`` is not used to clear cache but to do opposite !! You need to clear using: ``php artisan optimize:clear`` – OMi Shah May 19 '23 at 13:16
  • are you using cutom login controller? Probably there you might give a look or add the login controller code. – OMi Shah May 19 '23 at 13:17
  • @OMiShah although adding `:clear` clears a few more items but it seems to have done the trick, thanks. – burf May 19 '23 at 14:56
  • yes, it clear all caches including: view, config, route, cache and other compiled files. If you wish to clear only route you can use ``php artisan route:clear`` and so on. – OMi Shah May 19 '23 at 15:23
  • Does this answer your question? [Laravel 5 – Clear Cache in Shared Hosting Server](https://stackoverflow.com/questions/31455829/laravel-5-clear-cache-in-shared-hosting-server) – OMi Shah May 19 '23 at 15:24

0 Answers0