Introduce filament

This commit is contained in:
xiaomlove
2022-06-27 01:39:01 +08:00
parent aae45835ee
commit 1aca20070d
92 changed files with 3535 additions and 83 deletions

View File

@@ -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)