/laravel-restful-api-crud-using-passport

In this tutorial, I showed how to build Laravel RESTful API with authentication using the passport.

Primary LanguagePHP

Laravel RESTful API CRUD With Passport

In this tutorial, I’m going to show you how to build Laravel RESTful API with authentication using the passport. We are going to use Laravel’s API resources to build RESTful API. We will create Login, Register and Book CRUD API...

Tutorial Link

Build Laravel 5.8 RESTful API CRUD With Authentication Using Passport

Table of Contents

  1. Install Laravel and Basic Configurations
  2. Install Passport Package
  3. Migrate and Install Passport
  4. Passport Configuration
  5. Create Book Table
  6. Create Model and Controllers
  7. Create API Routes
  8. Call API using Postman

Output

Register API: Verb: POST, URL: http://laravel_api.test/api/register

Register API

Login API: Verb: POST, URL: http://laravel_api.test/api/login

Register API

Create Book API: Verb: POST, URL: http://laravel_api.test/api/books

Create Book API

All Books API: Verb: GET, URL: http://laravel_api.test/api/books

All Books API

Show Single Book API: Verb: GET, URL: http://laravel_api.test/api/books/1

Show Single Book API

Update Book API: Verb: PUT, URL: http://laravel_api.test/api/books/1

Update Single Book API

Delete Book API: Verb: DELETE, URL: http://laravel_api.test/api/books/1

Delete Single Book API

LICENCE

You can download the project, modify the code and use it anywhere you want without re-posting to your blog. Happy Coding :)

Thank you.