filament
This commit is contained in:
parent
89ffcae528
commit
6cb641788b
@ -9,6 +9,7 @@
|
||||
use App\Services\UserService;
|
||||
use Carbon\Carbon;
|
||||
use Database\Factories\UserFactory;
|
||||
use Filament\Panel;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
@ -22,7 +23,7 @@
|
||||
use Laravolt\Avatar\Avatar;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable
|
||||
class User extends Authenticatable implements FilamentUser
|
||||
{
|
||||
use Active;
|
||||
use HasApiTokens;
|
||||
@ -169,4 +170,9 @@ protected function casts(): array
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
public function canAccessPanel(Panel $panel): bool
|
||||
{
|
||||
return $this->isAdmin();
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
return [
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\Filament\AdminPanelProvider::class,
|
||||
App\Providers\FortifyServiceProvider::class,
|
||||
App\Providers\JetstreamServiceProvider::class,
|
||||
App\Providers\MenuServiceProvider::class,
|
||||
|
@ -11,6 +11,7 @@
|
||||
"php": ">=8.3",
|
||||
"barryvdh/laravel-dompdf": "^3.0",
|
||||
"culturegr/presenter": "^1.4",
|
||||
"filament/filament": "^3.2",
|
||||
"hashids/hashids": "^5.0",
|
||||
"laravel/framework": "^11.31",
|
||||
"laravel/jetstream": "^5.3",
|
||||
@ -65,7 +66,8 @@
|
||||
"scripts": {
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi"
|
||||
"@php artisan package:discover --ansi",
|
||||
"@php artisan filament:upgrade"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
||||
|
Loading…
Reference in New Issue
Block a user