|
1 | 1 | ## **Laravel REST API with Passport** |
2 | 2 |
|
3 | 3 | In this, We will learn that how to work with REST API. |
4 | | -We will use the in built functionality of laravel for authentication which call passport. |
| 4 | +We will use the in-built functionality of laravel for authentication which calls a passport. |
5 | 5 |
|
6 | | -Laravel provides more security for APIs. So, its good to work on API with Laravel. |
| 6 | +Laravel provides more security for APIs. So, it's good to work on API with Laravel. |
7 | 7 |
|
8 | 8 | #### **What is REST API?** |
9 | 9 | Rest API (Representational State Transfer) api's are web standards base architecture and uses HTTP Protocol for exchanging data between applications or systems. |
@@ -32,7 +32,7 @@ Go to your project path in terminal and run below command for passport authentic |
32 | 32 |
|
33 | 33 | composer require laravel/passport |
34 | 34 |
|
35 | | -After successfully install package, we require to get default migration for create new passport tables in our database. so let's run bellow command. |
| 35 | +After successfully installing the package, we are required to get default migration for creating new passport tables in our database. so let's run bellow command: |
36 | 36 |
|
37 | 37 | php artisan migrate |
38 | 38 |
|
@@ -137,7 +137,7 @@ Change config/auth.php file. |
137 | 137 |
|
138 | 138 | **4) Add Blog table and model** |
139 | 139 |
|
140 | | -Create migrtion file and model for Blog table by below command. |
| 140 | +Create migration file and model for Blog table by below command. |
141 | 141 |
|
142 | 142 | php artisan make:migration create_blogs_table |
143 | 143 |
|
@@ -207,7 +207,7 @@ Now open your database/migration/'your blog migration file'. and add your code h |
207 | 207 | |
208 | 208 | **6) Create Controller files** |
209 | 209 |
|
210 | | -We will create two controller files. One for Register and another for Blogs by below comand. |
| 210 | +We will create two controller files. One for Register and another for Blogs by below command. |
211 | 211 |
|
212 | 212 | php artisan make:controller RegisterController |
213 | 213 | |
@@ -438,7 +438,7 @@ Test Register API: |
438 | 438 |  |
439 | 439 |
|
440 | 440 | Let's test blog's CRUD. but before that, we need authentication to perform CRUD operation. because we used passport authentication. |
441 | | -So, we will take access 'token' from register API's response. and add the token to each API's headers like below: |
| 441 | +So, we will access 'token' from register API's response. and add the token to each API's headers like below: |
442 | 442 |
|
443 | 443 |  |
444 | 444 |
|
|
0 commit comments