Downloads
Stars
Version
This library contains a Laravel guard and authentication implementation for AWS Cognito user pools.
This library package requires PHP 7.0 or later
The recommended way to install is through Composer.
# Install Composer
curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest version:
composer global require lamhuyvu92/valentin-laravel-aws-cognito:dev-master
Add the service provider to the providers array in config/app.php
.
'providers' => [
...
lamhuyvu92\LaravelAwsCognito\ServiceProvider::class,
...
]
Add the middleware to either the middleware groups or the middleware array in app/Http/Kernel.php
.
protected $middlewareGroups = [
'api' => [
...
lamhuyvu92\LaravelAwsCognito\Middleware\CognitoAuthenticationMiddleware,
...
],
];
protected $routeMiddleware = [
...
'aws-cognito' => lamhuyvu92\LaravelAwsCognito\Middleware\CognitoAuthenticationMiddleware,
...
];
Publish then edit the config file.
php artisan vendor:publish --provider="lamhuyvu92\LaravelAwsCognito\ServiceProvider"
Edit the config/auth.php
file:
'guards' => [
'aws-cognito' => [
'driver' => 'aws-cognito',
'provider' => 'eloquent',
],
],
Reference from pmill/laravel-aws-cognito Copyright (c) 2018 valentin ([email protected])