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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners