Lumen 5.4 boilerplate for starting your first API.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jose Quintana 14622b8aaa exception fixes 2 years ago
app exception fixes 2 years ago
bootstrap lumen passport 2 years ago
config lumen passport 2 years ago
database lumen passport 2 years ago
public init 2 years ago
resources/views init 2 years ago
routes add example 2 years ago
storage init 2 years ago
tests init 2 years ago
.editorconfig init 2 years ago
.env.example init 2 years ago
.gitignore lumen passport 2 years ago
README.md add example 2 years ago
artisan init 2 years ago
composer.json lumen passport 2 years ago
composer.lock lumen passport 2 years ago
phpunit.xml init 2 years ago

README.md

Lumen 5.4 Boilerplate

Lumen 5.4 boilerplate for starting your first API.

Features

Configuration

# 1. Clone this repository
git clone --depth 1 https://github.com/joseluisq/lumen-54-boilerplate.git myapi

# 2. Enter to cloned directory
cd myapi

# 3. Install the dependencies
composer install

# 4. Run the migration
php artisan migrate

# 5. Configure Passport
php artisan passport:install

Usage

# 1. Run the development server
php -S localhost:8002 -t ./public

# 2. Request for some token

curl \
    -X POST "http://localhost:8002/oauth/token" \
    -d "grant_type=password" \
    -d "client_id=1" \
    -d "client_secret=FNjxzm1V5fZC52ZSvrEK7bpUMhedQYndl7n3s0nr" \
    -d "username=admin@mail.com" \
    -d "password=123456"

# 3. Request to an example url (use the "access_token" value for Bearer)
curl \
    -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJ..." \
    -X GET "http://localhost:8002/api/v1"

# Response:
# {"version":"Lumen (5.4.6) (Laravel Components 5.4.*)"}

Contribution

Feel free to send issues or pull requests.

License

MIT license

© 2017 José Luis Quintana