Relative Content

Tag Archive for phplaravellaravel-11

How to Handle Sanctum Error in Laravel 11

<?php use IlluminateSupportFacadesRoute; Route::prefix(‘admin’)->group(function () { Route::post(‘/login’, [AppHttpControllersAdminAuthController::class, ‘login’]); Route::middleware(‘auth:admin_sanctum’)->group(function () { Route::post(‘/logout’, [AppHttpControllersAdminAuthController::class, ‘logout’]); }); }); auth.php – ‘guards’ => [ ‘sanctum’ => [ ‘driver’ => ‘sanctum’, ‘provider’ => ‘users’, ], ‘user_sanctum’ => [ ‘driver’ => ‘sanctum’, ‘provider’ => ‘users’, ], ‘admin_sanctum’ => [ ‘driver’ => ‘sanctum’, ‘provider’ => ‘admins’, ], ], ‘providers’ => […]

Laravel Taking 30s to Respond

My code was working fine with optimum speed then it decided to be slow suddenly
taking almost 30s to just do 5 querrys
It shows on the debugbar that the querrys take 50ms which is fine..
Idk where is the slowdown coming from

How to disable CSRF token in Laravel 11?

I am working on a new project in Laravel 11 and need to disable CSRF protection for all routes. In Laravel 10, I achieved this by modifying the VerifyCsrfToken.php file

Make custom sessions table for additional user in laravel 11

I’m building a site where I have two different users, the backend user which is laravel’s default and frontend user for members and they have their own member area. The default user is from users table and members are from member table. Each has their own guards.