mostbyte / auth
Mostbyte authorization system from identity service
2.0
2023-08-21 09:53 UTC
Requires
- php: ^8.0.2
- guzzlehttp/guzzle: ^7.0
- illuminate/contracts: ^9.0|^10.0
- illuminate/database: ^9.0|^10.0
- illuminate/support: ^9.0|^10.0
Requires (Dev)
- orchestra/testbench: ^7.0
- phpunit/phpunit: ^9.0
README
Mostbyte authorization system from identity service
Installation
To get the latest version of Mostbyte auth
, simply require the project using Composer
composer require mostbyte/auth
Instead, you may of course manually update your require block and run composer update
if you so choose:
{ "require": { "mostbyte/auth": "^2.0" } }
Publishing config files
php artisan vendor:publish --provider="Mostbyte\Auth\AuthServiceProvider"
Warning: In production, in
.env
you should specifyLOCAL_DEVELOPMENT=false
. Otherwise your all http requests will be handled by faker
Using
Using in routes
use Mostbyte\Auth\Middleware\IdentityAuth; Route::middleware(IdentityAuth::class)->get("foo", function () { return "bar"; });
or specify in App\Http\Kernel.php
protected $routeMiddleware = [ // other middlewares... "identity" => \Mostbyte\Auth\Middleware\IdentityAuth::class ];
and in routes
Route::middleware('identity')->get("foo", function () { return "bar"; });