drewlabs / lv-oauth-clients
drewlabs/oauth-clients bindings for laravel framework
Requires
- php: ^8.0
- drewlabs/core-helpers: ^0.3.0
- drewlabs/oauth-clients: ^0.2.0|^0.3.1
- drewlabs/query-contracts: ^0.3.0
- illuminate/console: ^9.0|^10.0|^11.0
- illuminate/database: ^9.0|^10.0|^11.0
Requires (Dev)
- phpunit/phpunit: >=6.0
- vlucas/phpdotenv: >=3.0
README
drewlabs/oauth-clients
laravel framework bindings. The library provide laravel developers with eloquent compatible oauth
client.
Usage
To use library components in your laravel application, please register library service provider in the list of application service providers:
return [ // ... 'providers' => [ // ... \Drewlabs\Laravel\Oauth\Clients\ServiceProvider::class // ... ], // ... ];
Note: Doing the step above might not be required, because the library uses laravel service auto discovery to register the it service provider automatically. But in case of any issue, make sure the service is properly registered.
Configuration assets
Library components such as client secret hashing, should be configured for components to work properly. Therefore the library comes with basic configuration file that can be imported into your application configuration using laravel vendor:publish command:
php artisan vendor:publish --tag=oauth-clients-configs
Migrations
For easy integration with laravel eloquent, library provides a model for properly working with auth clients. To publish migration files for the eloquent model:
php artisan vendor:publish --tag=oauth-clients-migrations
Note You can use the --force
flag if the migration already exists and should be overridden
Then you run:
php artisan migrate # to apply your migration changes
Creating clients using cli
After the above steps completed, you can go to your command while being in development environment to generate auth client instance:
To create a password client:
php artisan drewlabs:oauth-clients:create --password
To create a personnal access client:
php artisan drewlabs:oauth-clients:create --personal
Note Please use php artisan drewlabs:oauth-clients:create --help
for more options
Note Documentation is still under development to include future changes. Thanks.