add bitinflow payments subscriptions

This commit is contained in:
2022-05-08 22:53:02 +02:00
parent b5b4f9cf5e
commit 032c771e49
14 changed files with 274 additions and 403 deletions

61
AUTH.md Normal file
View File

@@ -0,0 +1,61 @@
# Implementing Auth
This method should typically be called in the `boot` method of your `AuthServiceProvider` class:
```php
use GhostZero\BitinflowAccounts\BitinflowAccounts;
use GhostZero\BitinflowAccounts\Providers\BitinflowAccountsSsoUserProvider;
use Illuminate\Http\Request;
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
Auth::provider('sso-users', function ($app, array $config) {
return new BitinflowAccountsSsoUserProvider(
$app->make(BitinflowAccounts::class),
$app->make(Request::class),
$config['model'],
$config['fields'] ?? [],
$config['assess_token_field'] ?? null
);
});
}
```
reference the guard in the `guards` configuration of your `auth.php` configuration file:
```php
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'bitinflow-accounts',
'provider' => 'sso-users',
],
],
```
reference the provider in the `providers` configuration of your `auth.php` configuration file:
```php
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
'sso-users' => [
'driver' => 'sso-users',
'model' => App\Models\User::class,
'fields' => ['first_name', 'last_name', 'email'],
'assess_token_field' => 'sso_access_token',
],
],
```