Good afternoon everyone! In my project I have to create a new user which will be a restaurant directly in the user’s registration. Once registered, I gave the possibility to associate more types of restaurant to the logged in user. I made already migrations and relations everything is working. This is what i wrote to ..
Category : authentication
I am trying to register a new user into my system, and right after make the login automatically. How can I call another function in the same Controller and pass $request variables to it? I did the var_dump, login function is getting data, the login is being made, but it’s not redirecting to index (line ..
I’m trying to make the Laravel’s auth middleware work but I’m getting an error and I have no idea how to solve it. Illegal offset type vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php:68 AuthManager.php public function guard($name = null) { $name = $name ?: $this->getDefaultDriver(); return $this->guards[$name] ?? $this->guards[$name] = $this->resolve($name); // <– This is where the error is } app/Http/Kernel.php ..
I have two domain 1) app1.xyz.com 2) app2.xyz.com app1.xyz.com is a laravel project. app2.xyz.com is a react js project. if I can log in from app1.xyz.com and I open app2.xyz.com then automatic redirect to Dashboard. Login API is on the laravel project side. how I manage login sessions for both using cookies? how can I ..
I have the following set-up: Laravel running with Homestead Domain laravel-api.test pointing to my Homestead environment React (npx create-react-app) running locally with a custom HOST app.laravel-api.test:3000 Laravel In my routes (routes/api.php) I added two routes: Route::post(‘login’, [AppHttpControllersLoginController::class, ‘login’]); Route::middleware(‘auth:sanctum’)->get(‘books’, [AppHttpControllersBookController::class, ‘list’]); In my config/cors.php I added: ‘paths’ => [‘api/*’, ‘sanctum/csrf-cookie’], ‘allowed_methods’ => [‘*’], ‘allowed_origins’ => ..
I’am working on a larger web app using laravel (v8) because of the expected size to which the project probably will grow I decided to split the frontend and backend into two different repos from the beginning. Now I want to implement user authentication for the frontend my problem now is how should I approach ..
I’m making an API using Laravel and I’m building the login system. When I’m trying to get the logged user I get 401 error when the login seems to work. Here’s my vuex module where I have my action to login the user: import axios from ‘@/api’; export default { namespaced: true, state: { user: ..
I want to customize laravel breeze’s login logic and users can login with username and mobile for example. in previous version of laravel, login logic uses AuthenticatesUser trait and I could override methods and customize easily , but now there is no trait and method to override what should I do now ? I search ..

I am having laravel project version 8.23 with the jetstream PFA image below How to disable this part in the jetstream Sourc..
The default Breeze authentication installation uses the RegisteredUserController to register a new user, which works perfectly. Route::post(‘/register’, [RegisteredUserController::class, ‘store’]) ->middleware(‘guest’); In the next step, the ‘verification.verify’ route throws a unauthenticated exception, as the user still needs to be verified. Route::get(‘/verify-email/{id}/{hash}’, [VerifyEmailController::class, ‘__invoke’]) ->middleware([‘auth’, ‘signed’, ‘throttle:6,1’]) ->name(‘verification.verify’); My RegisteredUserController does do a Auth::login but this does ..
The default Breeze authentication installation uses the RegisteredUserController to register a new user, which works perfectly. Route::post(‘/register’, [RegisteredUserController::class, ‘store’]) ->middleware(‘guest’); In the next step, the ‘verification.verify’ route throws a unauthenticated exception, as the user still needs to be verified. Route::get(‘/verify-email/{id}/{hash}’, [VerifyEmailController::class, ‘__invoke’]) ->middleware([‘auth’, ‘signed’, ‘throttle:6,1’]) ->name(‘verification.verify’); My RegisteredUserController does do a Auth::login but this does ..
This is a strong doubt that I have, I will put you in context: I need to create a distributed system, in my general diagram I have an API server and an authentication server, both servers are separated. So, I want to manage my authentication via OAuth 2 Password Grant Tokens using Laravel, but I’m ..
je suis entrain de créer une application web , mais je ne sais pas comment gérer la création de plusieurs compte utilisateurs par les utilisateurs eux même ? Merci à vous de m’aider. Sourc..
i’m trying to develop a multi tenant, app in laravel, with multiple DBs and subdomains, so far i’m using the default user guard for authenticating in the main domain let’s say it’s example.com, it works fine, i’m also using a different guard for the subdomains, registration works fine, but the login seems to be broken, ..
I have a Laravel 7 API with Sanctum authentication, VueJS (Nuxt SPA) frontend. After registration (Laravel auth scaffolding) the user must verify their email address. Generally the app+auth is working fine but I’ve noticed that the following is possible: User registers an account User gets an email with the verification URL and uses it, handled ..
From reading the Laravel docs, it appears that when using Sanctum Vue will just use the cookie-based authentication. I was trying to move an existing app (with login done using Livewire) to Vue, but calls direct to my first api endpoint were redirecting to the login page. So I created a clean installation of Larvel, ..
Error This is the error I have been receiving while using Postman BadMethodCallException: Method IlluminateAuthRequestGuard::attempt does not exist. in file C:xampphtdocsproject-appvendorlaravelframeworksrcIlluminateMacroableTraitsMacroable.php on line 103 I have two tables users and employees and my login API is only working for users table but not for employees table. This is my EmployeeController public function employeeLogin(){ if(Auth::guard(’employee-api’)->attempt([’email’ => ..
User password changes in laravel8 after some time, maybe a day or more. when I see the database, the password hash has changed. I used default laravel authentication, I had this issue. so I wrote this login code, but still I have the issue. here is login controller: public function login(Request $request) { $email_username = ..
User password changes in Laravel 8 after a period of time post logout, maybe a day or more. When I look into the database, the password hash has changed. I used the default Laravel authentication and had this issue, so I wrote the login code below, but still, I have the issue. LoginController public function ..
I have a project with a laravel 7.x backend and Unity front end. My problem is that I can’t get the current user when making API requests from Unity webGL. All of the APIs work perfectly when building Unity as a mobile app and in Postman but running the exact same API requests from webGL ..
Hello guys im trying to customize the Register of Laravel and i have this working but i need to add in some fields the last ID registered… in my actual code it register all ok.. but no login automatic afte register. class RegisterController extends Controller { /* |————————————————————————– | Register Controller |————————————————————————– | | This ..
I am developing a web page. I have included the Auth library in my project. However, I also have to login for the contact and about us pages. How can I fix this? My web.php : Route::get(‘/’, function () {return view(‘index’); }); Route::get("/abaout", [HomeController::class, "indexAbaout"])->name("abaout"); Route::get("/services", [HomeController::class, "indexServices"])->name("services"); Route::get("/projects", [HomeController::class, "indexProjects"])->name("projects"); Route::get("/products", [HomeController::class, "indexProducts"])->name("products"); Route::get("/contact", ..
I’m working on creating APIs for the first time using laravel, please excuse me if I mention anything incorrect and let me know how to correct it. I have followed this article to create API authentication, https://www.toptal.com/laravel/restful-laravel-api-tutorial now I’m able to register the user and I’m getting api-token as per the blog, but when I ..
I am making an application in VUE in which users must log in to access the information. The login process is done through a Laravel API that will collect the information from a database. To send the data from the VUE form I do the following in the VUE api: import axios from ‘axios’; const ..

I’m making an API with Laravel using Sanctum for authentication, and I having a error when I put the logout route inside auth:sanctum middleware, like this: But when I put this route outside the middleware it works… The easiest way is leaving the route outside, but can u recommend me what is the best practice ..