mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
Introduce filament
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Auth\NexusWebGuard;
|
||||
use App\Auth\NexusWebUserProvider;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -31,6 +33,11 @@ class AuthServiceProvider extends ServiceProvider
|
||||
Auth::viaRequest('nexus-cookie', function (Request $request) {
|
||||
return $this->getUserByCookie($request->cookie());
|
||||
});
|
||||
|
||||
Auth::extend('nexus-web', function ($app, $name, array $config) {
|
||||
// 返回 Illuminate\Contracts\Auth\Guard 的实例 ...
|
||||
return new NexusWebGuard($app->make('request'), new NexusWebUserProvider());
|
||||
});
|
||||
}
|
||||
|
||||
private function getUserByCookie($cookie)
|
||||
|
||||
Reference in New Issue
Block a user