diff options
author | Camil Staps | 2015-05-20 17:40:25 +0200 |
---|---|---|
committer | Camil Staps | 2015-05-20 17:40:25 +0200 |
commit | aa15a46043fa975711efc4e689021511fbcdc62e (patch) | |
tree | 28cdebec37f1955e47b34e0f6afb38c355bce857 | |
parent | Merge branch 'master' of github:Botleagues/API (diff) |
Installation instructions
-rw-r--r-- | README.md | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -1,2 +1,41 @@ # API RESTful PHP API for Botleagues + +# Installation +* Create a new laravel project: + + laravel new <name-of-folder> + +* Remove the default content: + + php artisan fresh + +* Add the BotleaguesAPI package using composer + +* In `config/app.php`, add the following `ServiceProvider`s: + + * `CamilStaps\BotleaguesApi\BotleaguesApiServiceProvider` + * `Dingo\Api\Provider\LaravelServiceProvider` + +* Publish the `api` and `botleaguesapi` configuration files from `camil-staps/botleagues-api` + +* In `config/api.php`, set `auth` to: + + 'auth' => [ + 'basic' => function ($app) { + return new Dingo\Api\Auth\Provider\Basic($app['auth']); + }, + 'token' => function ($app) { + return new \CamilStaps\BotleaguesApi\TokenAuthenticationProvider; + } + ], + +* In `config/botleaguesapi.php`, set `allowed_origin` to (an array of) the allowed origin(s) of API requests. Use `*` for a wildcard. + +* In `/.env`, set the appropriate configuration values: + + * `APP_ENV`, `APP_DEBUG`, `APP_KEY`, `APP_URL` + * `DB_HOST`, `DB_DATABASE`, `DB_USERNAME`, `DB_PASSWORD` + * `API_VERSION=v1`, `API_DEBUG`, `API_DOMAIN` + +After this, you should be good to go. Add configuration settings and the like as usual. |