sdk laravel-bootcamp
A boot camp who initialize a series of tools for starter of laravel 5.5
jetwaves/laravel-bootcamp
A boot camp who initialize a series of tools for starter of laravel 5.5
- Saturday, April 7, 2018
- by jetwaves
- Repository
- 1 Watchers
- 1 Stars
- 39 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 8 % Grown
laravel-bootcamp
A boot camp who initialize a series of tools for starter of laravel 5.5, (*1)
-
Installation:, (*2)
composer require jetwaves/laravel-bootcamp
- Edit config/app.php, add following line into 'providers' array
Jetwaves\LaravelBootcamp\Providers\LaravelBootcampServiceProvider::class,
- Edit '.env', set your database options (database name, username, password)
-
Jwt (Json Web Token ) Integration., (*3)
-
Initialisation, (*4)
Run command in console:
php
php artisan bootcamp:init
, (*5)
- Test it's working:
- Run
php artisan serve
in cli.
- Import "Tests/postman/Laravel_Jwt_integration_Test.postman_collection.json" into Postman
- Run the tests 1-9. You should see following results:
- test1:
php
it works !!!
- test2:
php
"error": "Token is required"
- test3:
php
The name field is required.,The email field is required.,The password field is required.
- test4:
php
{
"status": true,
"message": "JwtUser created successfully",
"data": {
"name": "test1",
"email": "test@test.com1",
"updated_at": "2018-02-17 12:12:36",
"created_at": "2018-02-17 12:12:36",
"id": 2
}
}
- test5:
php
The email field is required.,The password field is required.
- test6:
php
"invalid_email_or_password"
- test7:
php
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.***********************"
- test8: (change the 'Authorization' field of the header with 'Bearer '.$tokenReturnedInTest7 )
php
it works !!!
- test9: (change the 'Authorization' field of the header with 'Bearer '.$tokenReturnedInTest7 )
php
"result": {
"id": 1,
"name": "test1",
"email": "test@test.com1",
"created_at": "2018-02-17 11:57:01",
"updated_at": "2018-02-17 11:57:01"
}
-
Usage:, (*6)
A simple implicit router protected with jwt is declared in routes/api.php, (*7)
Routes without jwt protection:, (*8)
GET http://localhost:8000/api/noauth/ControllerName/snake-form-function-name is served by ControllerNameController->getSnakeFormFunctionName()
POST http://localhost:8000/api/noauth/ControllerName/snake-form-function-name is served by ControllerNameController->postSnakeFormFunctionName()
Routes with jwt protection:, (*9)
GET http://localhost:8000/api/withauth/ControllerName/snake-form-function-name is served by ControllerNameController->getSnakeFormFunctionName()
POST http://localhost:8000/api/withauth/ControllerName/snake-form-function-name is served by ControllerNameController->postSnakeFormFunctionName()
Cf. Jetwaves/ Laravel Implicit Router to know more about implicit router for laravel 5.2+, (*10)
-
Errors and eventual problems:, (*11)
- To be completed later.
dev-master
9999999-dev
A boot camp who initialize a series of tools for starter of laravel 5.5
Sources
Download
MIT
The Requires
by
jetwaves
laravel
api
authentication
jwt
token
v1.0.1
1.0.1.0
A boot camp who initialize a series of tools for starter of laravel 5.5
Sources
Download
MIT
The Requires
by
jetwaves