https://dev.to/lloyds-digital https://dev.to/rcerljenko While building your app in Laravel PHP Framework, you have multiple ways of protecting your API routes with various auth guards or Basic auth. Would it be nice to support both API guard and Basic auth at the same time? In default Laravel app you can protect your API routes like this: // routes/api.php use Illuminate\Support\Facades\Route; Route::middleware('auth:api')->group(function (): void { }); Enter fullscreen mode

Now we're able to authenticate our users on API routes with both API guard and fallback Basic auth by simply using a default auth middleware.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners