vendredi 29 mars 2019

Removing redirect for specific route groups

I'm looking to create a route group that enables particular users to view information on my site without being authenticated.

At the moment, i've created a route service provider called 'public' as follows:

Route::get('customer/application', function () {
    return view('customerview.customer-application');
});

When I write 'php artisan route:list' the following comes up for the route:

Method: GET | HEAD URL: customer/application Middleware: ''

I have removed all middleware in an attempt to bypass auth, but with no luck.

The area which is redirecting me to the login page is here in App\Exceptions\Handler.php:

protected function unauthenticated($request, AuthenticationException $exception)
{
    if ($request->expectsJson()) {
        return response()->json(['error' => 'Unauthenticated.'], 401);
    }
    return redirect()->guest('login');
}

I also tried assigning the route to 'guest' group but no help. How can I bypass the return redirect()->guest('login'); for different groups?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HNJO3q
via IFTTT

Aucun commentaire:

Enregistrer un commentaire