Macfa's avatar
Level 1

how to fix Route [login] not defined

hi, i got Route [login] not defined Error when i open my homepage

research this error and i known what error is.

this error occur when login route doesnt exist

problem is .. I don't have login page also i don't have login route

  • Proccess I click login button and login google using sociallite tool

i modify path to right path in thease files Authenticate.php RouteServiceProvider.php -> HOME variable

I want to redirect to '/' if user not logged how to fix it ?

0 likes
9 replies
Macfa's avatar
Level 1

@SilenceBringer thanks reply

    protected function redirectTo($request)
    {
        if (! $request->expectsJson()) {
//            return route('mainHomepage');
            return redirect('/');
        }
    }

Is there anything else I'm missing out on?

Snapey's avatar

What does the rest of the error message say?

Macfa's avatar
Level 1

@Snapey thanks reply

Symfony\Component\Routing\Exception\RouteNotFoundException
Route [login] not defined.

- stack trace
Illuminate\Routing\UrlGenerator::route
vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php:429

I'm in stuck this issue

Snapey's avatar

So you have something that is using the route() helper. The rest of the stack trace should tell you where

Please or to participate in this conversation.