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.