File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -63,13 +63,13 @@ The user needs to be logged in. Programmatically it looks like this.
6363Auth::setUser($user);
6464```
6565
66- And not the package will create ApiKeys for the Authorized user.
66+ Now the package will create ApiKeys for the authorized user.
6767``` php
6868LaravelApiKeys::create(LaravelApiKeyType::PRODUCTION); // default is SANDBOX
6969```
7070
7171## Using the your API Keys
72- Change config/auth.php
72+ Change the guards section of config/auth.php
7373``` php
7474 'guards' => [
7575 'web' => [
@@ -94,7 +94,7 @@ Route::middleware('auth:lak')->get('/user', function (Request $request) {
9494});
9595```
9696
97- Check your work from the command line .
97+ Replace the x-api-key header with your own key and test it .
9898``` bash
9999
100100$ curl -X GET \
@@ -103,7 +103,16 @@ $ curl -X GET \
103103 -H ' x-api-key: al4PA8V5jSuq4oFJOxK6lS4CeZEkDFtayBObJTHJ'
104104
105105```
106-
106+ The above curl command will return the user authorized by the ApiKey.
107+ ``` json
108+ {
109+ "id" : 1 ,
110+ "name" : " Ed Anisko" ,
111+ "email" : " ed@nrml.co" ,
112+ "created_at" : " 2019-10-17 07:18:59" ,
113+ "updated_at" : " 2019-10-17 07:18:59"
114+ }
115+ ```
107116### Testing
108117
109118``` bash
You can’t perform that action at this time.
0 commit comments