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

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