dinkara / dinkoapi
:package_description
v1.0.0
2019-10-14 11:42 UTC
Requires
- php: ~5.6|~7.0
- dinkara/repobuilder: 1.*
- illuminate/support: ~5.1
- league/fractal: ^0.17.0
- tymon/jwt-auth: 0.5.*
Requires (Dev)
- phpunit/phpunit: >=5.4.3
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2025-03-06 01:06:10 UTC
README
Requirements
- Laravel ~5.5 or higher
Composer Install
composer require dinkara/dinkoapi
Publish service
If it is not automaticly published, add the service provider in config/app.php
:
Dinkara\RepoBuilder\RepositoryBuilderServiceProvider::class, Dinkara\DinkoApi\Providers\DinkoApiServiceProvider::class, Dinkara\DinkoApi\Providers\ApiResponseServiceProvider::class, Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class
Also you need to add new aliases for available facades in config/app.php
:
'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class, 'JWTFactory' => Tymon\JWTAuth\Facades\JWTAuth::class, 'ApiResponse' => Dinkara\DinkoApi\Facades\ResponseFacade::class,
For publishing new services you need to execute the following line
php artisan vendor:publish --all
To register new middleware you need to add following line in your app\Http\Kernel.php
'dinkoapi.auth' => \Dinkara\DinkoApi\Http\Middleware\DinkoApiMiddleware::class,
And now you can protect your routes with JWT authenticate, simply adding dinkoapi.auth
as middleware in your route.