raviSoni's avatar

A user can access home page without authentication

Basically what i want to do , I am creating a Ecommerce website but when i run a command php artisan ui:auth it creates all neccessary files but main problem is it can't allow a user to access homepage without login or registration what to do ???

0 likes
4 replies
siangboon's avatar

check the HomeController or any controller related and add the except to exclude the authentication checking for the resource you don't need, for example:



public function __construct()
    {
        $this->middleware('auth', ['except' => ['index', 'show']]);
    }

btw, ui:auth is only available on Laravel 6.

munazzil's avatar

Just remove your auth routes from youe web.php and try with below commaand in your cmd and keep whatever routes you want,

   //remove Auth::routes(); from web.php

    php artisan route:list
raviSoni's avatar

no this is not working any other option ??

Please or to participate in this conversation.