From the course: Building Laravel and Vue.js 2 Web Apps
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Building an API with Laravel Passport
From the course: Building Laravel and Vue.js 2 Web Apps
Building an API with Laravel Passport
- [Instructor] In this video, we'll build an API with token authentication using Laravel Passport. For actions that will invoke with Ajax, we could put the routes here in web.php and rely on the same cookie-based sessions for authentication, but it's nice to keep them separate in this API routes file which is in the same folder. This API guard used here uses token authentication by default, and it's also nice to build a universal API with that token authentication in case you need it later, for instance, for a completely separate app, web or mobile, or for third party integrations with your system. We can setup an API without much effort at all using Laravel Passport which is a complete OAuth2 server and API authentication package. You can install it with composer. Just type composer require laravel\passport. Passport comes with migrations, although they won't be placed in the normal migrations folder. So next, we'll run artisan migrate to create the tables to store the API access…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Integrating a layout6m 46s
-
(Locked)
Creating a model and seeding the database4m 46s
-
(Locked)
Building views with Blade templates5m 6s
-
(Locked)
Injecting props in Vue components4m 49s
-
(Locked)
Building a CRUD component5m 9s
-
(Locked)
Managing scrolling and focus4m 18s
-
(Locked)
Protecting routes and models with policies5m 5s
-
(Locked)
Building an API with Laravel Passport5m 1s
-
(Locked)
Calling an API from Vue7m 46s
-
-
-
-