| Laravel | Auth |
|---|---|
| < 10.x | 2.x |
| 11.x,12.x | 3.x |
To get the latest version of Mostbyte auth, simply require the project using Composer
composer require mostbyte/authInstead, you may of course manually update your require block and run composer update if you so choose:
{
"require": {
"mostbyte/auth": "^3.0"
}
}php artisan vendor:publish --provider="Mostbyte\Auth\AuthServiceProvider"Warning: In production, in
.envyou should specifyLOCAL_DEVELOPMENT=false. Otherwise your all http requests will be handled by faker
use Mostbyte\Auth\Middleware\IdentityAuth;
Route::middleware(IdentityAuth::class)->get("foo", function () {
return "bar";
});or specify in App\Http\Kernel.php
protected $middlewareAliases = [
// other middlewares...
"identity" => \Mostbyte\Auth\Middleware\IdentityAuth::class
];and in routes
Route::middleware('identity')->get("foo", function () {
return "bar";
});