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