Questions tagged [laravel-authentication]

Laravel ships with several pre-built authentication controllers for user registration, authentication, and password reset.

Laravel ships with several pre-built authentication controllers for user registration, authentication, and password reset.

311 questions
4
votes
4 answers

Prevent logout after updating user password in Laravel 5.5

Beginning with Laravel 5.3, this middleware was added... \Illuminate\Session\Middleware\AuthenticateSession While it's definitely a benefit for security purposes, it's also responsible for logging the user out (presenting the user with the login…
4
votes
8 answers

How to get logged in user data into Laravel controller

I am working on laravel 5.4, i have used the auth for user login at client side,now i want the logged in user details at the Controller, view side by writing below code i got that: {{ Auth::user()->name }} // this works on view page only. Suggest…
Anand Maurya
  • 134
  • 1
  • 1
  • 10
3
votes
1 answer

Laravel 7 multi auth with 3 different tables

I'm new to Laravel 7 and i'm creating an application that requires 3 different user tables ( Admin , salesperson, warehouse manager ) Each user can login from a separate login form and has a different dashboard. I want to implement authentication…
zineb
  • 41
  • 1
  • 6
3
votes
0 answers

Auth is not working in middleware in Laravel

I have successfully loggedin my adminpanel but while I redirect to dashboard after login using middleware it's not working. login controller if (Auth::attempt(['username' => $request->email, 'password' => $request->password])) { return…
3
votes
4 answers

Laravel Auth manually login by id

I am new to laravel and I am working with a functionality where we insert data in user table with DB::insert(); After that i get last id with $user_id = DB::getPdo()->lastInsertId(); Now I want user to login after register and I am trying to…
Anuj kumar
  • 31
  • 1
  • 4
3
votes
1 answer

Argument 1 passed to App\Http\Controllers\Auth\LoginController::attemptLogin() must be an instance of App\Http\Controllers\Auth\Request

I am adding 1 attribute for authentication, but it doesn't work. i'm not change anything except adding this 2 method in my LoginController protected function credentials(Request $request) { return $request->only($this->username(),…
3
votes
1 answer

Auth::attempt () in Laravel 5.5 always return false

I use Hash to bcrypt password in my seeder, and in my controller, I use Auth to check request from client, but it always returns false, I don't know why. This is the code: My HomeController: public function login(Request $request) { …
3
votes
1 answer

How to override default login mechanism of Laravel 5.6?

I want the user to login only if status field in users table is set to 1. If it is 0 then simply return error stating user account is not active. So after creating the status field in the table, where can I make the check that the user'status is 1…
Raj
  • 1,596
  • 1
  • 18
  • 38
2
votes
0 answers

Laravel how to get user id in controller from foreach

I am new to Laravel and I want to get the user's id(in HomeController.php) in the foreach(in home.blade.php). I am using Laravel 6.*. This is the code in home.blade.php @foreach($follow as $user)
2
votes
1 answer

laravel formrequest before middleware

I know, this is a complex case but maybe one of you might have an idea on how to do this. Concept I have the following process in my API: Process query string parameters (FormRequest) Replace key aliases by preferred keys Map string parameters to…
2
votes
0 answers

Unable to share Laravel session in sub-domain using different guard

Description : I've two Laravel application on same server but on different path. And I want to merge both application by sharing session. Both of these application has domain and sub-domain combination namely: example.com tool.example.com And I'd…
2
votes
2 answers

How to change api_token parameter to some custom parameter like api_key or key

I have a Laravel application using API token authentication. By default, the user needs to pass the api_token parameter as part of the URL, but I want to change api_token to a custom name parameter like api_key. Currently the full URL looks…
2
votes
0 answers

Laravel Breeze Multi Auth Two register forms with different routes

I'm using laravel breeze as auth scaffolding package I want to create this stuff : The auth countrollers : app\Http\Controllers\Auth\Buyer If the Visitor choose to Create an account "Sign Up" as "Buyer" it will redirect him/her to specified…
jhon-jhones
  • 241
  • 1
  • 7
2
votes
1 answer

Laravel 8 Does Not Log Me In With Correct Credentials

I'm working with Laravel 8 and since now I have developed my project so well but today I just realized that I can not login to my account no more! I mean after typing the email and password from the user that already exists in users table, it…
2
votes
0 answers

How to customize login error messages in Fortify Laravel 8

When users enter wrong username or password they get the following message: These credentials do not match our records. How can I change this message to something like: You have entered an invalid username/password or both. Please try again. I…
1
2
3
20 21