Category: Laravel, api

This tutorial assumes you already know how to set up jQuery DataTables for your webpage, and at the least basic Laravel knowledge. Security concerns: This authentication solution is easier to do, compared to authentication using Laravel Passport, but using the latter would be more secure. Laravel’s API Token guard should only be used for trivial authentication, and NOT for authentication involving sensitive user data, etc.

To make sure that we use Laravel’s built-in API token authentication driver (or in some cases, people call this the “guard”), we edit config/auth.php like so: Note that for most projects, this is the default setting.

In your routes/web.php: Second, we make sure that the built-in token guard for Laravel is utilized for the API route.
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