mostbyte/auth

Mostbyte authorization system from identity service

2.0 2023-08-21 09:53 UTC

This package is auto-updated.

Last update: 2024-04-21 11:41:45 UTC


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 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 $routeMiddleware = [
    // other middlewares...
    "identity" => \Mostbyte\Auth\Middleware\IdentityAuth::class
];

and in routes

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