mostbyte/auth

Mostbyte authorization system from identity service

3.2.7 2025-04-16 10:00 UTC

README

Mostbyte authorization system from identity service

Versions

Laravel Auth
< 10.x 2.x
11.x,12.x 3.x

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": "^3.0"
  }
}

Publishing config files

php artisan vendor:publish --provider="Mostbyte\Auth\AuthServiceProvider"

Warning: In production, in .env you should specify LOCAL_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 $middlewareAliases = [
    // other middlewares...
    "identity" => \Mostbyte\Auth\Middleware\IdentityAuth::class
];

and in routes

Route::middleware('identity')->get("foo", function () {
    return "bar";
});