Questions tagged [laravel-guard]

15 questions
7
votes
5 answers

How to enable both api and web guard in laravel

Laravel 5.7 PHP 7.2.10 Currently I am able to use any one of web and api guards, is there any way to allow both, so that both web app and api will work together. Something like return [ /* …
4
votes
1 answer

Class App\Http\Middleware\Authenticate:api does not exist on Broadcasting

I am having an issue with the auth:api guard working with broadcasting. I get the error Class App\Http\Middleware\Authenticate:api does not exist if I call php artisan route:list. BroadcastServiceProvider.php:
1
vote
1 answer

Laravel Multiple Guard Authentication Failure

I am creating a Laravel Website with multiple guards. My Goal is to be able to login as Admin, Employee and User using session and User-API using passport. Everything worked fine. However, I wasn't able to Login as Employee. Here is the git repo.…
Hilal Najem
  • 69
  • 1
  • 9
1
vote
1 answer

Create a simple guard in laravel

I am trying to implement a very simple authentication mechanism with Laravel. I need to protect certain routes so they are viewable from a specific IP address. I want to do this: if ($_SERVER['REMOTE_ADDR'] != '123.45.67.89') { return…
idan
  • 43
  • 5
0
votes
1 answer

Laravel 8 Multi Auth Guard using Fortify but unable to implement Forgot Password and Verify Email for Admin

I implemented Fortify Multi Auth Guard (Admin and User) with Custom view. I have separate login view for admin and user. I have also implemented Forgot Password for user and it is working very well. I am just unable to implement Forgot Password for…
Kumar
  • 1
  • 1
0
votes
2 answers

laravel breeze Multi Auth - Admin Guard with two diffirent registration

I'm using laravel breeze as auth scaffolding package.I want to create Multiple Authentication using laravel guards for two different registration form for two User Types (Admin, User). The Main Idea of what I want to achieve : I have two tables in…
Haron
  • 829
  • 7
  • 13
0
votes
0 answers

How do I use multiple authentication methods in Laravel?

I've inherited a project that uses Laravel's authentication for an admin panel. The admin panel takes advantage of routes from both web.php and api.php. The people who log into the admin panel are called users. This project has also has an API used…
0
votes
0 answers

Laravel multiple session lifetimes for multiple guards

I have two guards with same session and two tables. Is there a way to use two session ending lifetimes? This is my config auth.php 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], …
0
votes
1 answer

Why does custom guard get logged out on page reload/redirect?

I created a new guard for logging in custom type of users. I can login users with Auth::attempt('webguest'), but login does not persist over page reloads. It works only when I use web-guard. See for example my two test routes: Route::get('test1',…
0
votes
1 answer

How can i submit form using name route when i am logged in with admin guard?

im using multiple authentication using guards and i stuck with routing of resource Controller I have two Different Controllers with same name in different namespaces Route::namespace('Admin')->prefix('admin')->group(function(){ …
0
votes
1 answer

Laravel loginUsingId() didnt remeber the login state on new page

I am trying to integrate Socialite in my laravel web app. When I am trying to login with FB ID using loginUsingId() it makes user login and redirect to homepage as expected, but when I visited some other page on the same domain it forgets that the…
0
votes
2 answers

Laravel 5.8 Multiple middlewares using guards and specific options for each guard

I have a laravel application that allows both admins and customers to gain access to it and for each one of them will have specific permissions using 2 separated tables for each type of user to auth and 2 different guards. what I need now is to give…
0
votes
2 answers

Laravel get user id in unprotected route

I am using Laravel guard to to protect routes, now I want to get user id in unprotected (common) routes, for example: Protected: /Profile Unprotected: /Search I able to get user id in protected routes, for example ProfileController.php, like…
tour travel
  • 1,266
  • 1
  • 6
  • 28
0
votes
1 answer

How to authenticate and logging in user in laravel using guard?

I'm trying to make authentication using guard in Laravel 5.8. Authentication is passed but somehow it's not logging in the user. public function login(Request $request) { $email = $request->email; $password = $request->password; $credentials…
Abaij
  • 767
  • 2
  • 11
  • 30
-1
votes
1 answer

Laravel authentication with google is not working with guard

I have been working with a Laravel project with multiple guard authentications. one of my guard name is 'customer'. Only customers are allowed to login with their Google Account. Previously I was using Laravel default Users Model as Customer account…