From 9c6bf2eedeab719e89cedacd1d5465a870e02f5b Mon Sep 17 00:00:00 2001 From: Jesse Visser Date: Thu, 8 Feb 2024 14:00:23 +0100 Subject: [PATCH] Fix user having access to admin panel --- app/Models/User.php | 10 ++++++++-- docker-compose.yml | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index 4d7f70f..1c0c5c6 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,13 +2,14 @@ namespace App\Models; -// use Illuminate\Contracts\Auth\MustVerifyEmail; +use Filament\Models\Contracts\FilamentUser; +use Filament\Panel; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; -class User extends Authenticatable +class User extends Authenticatable implements FilamentUser { use HasApiTokens, HasFactory, Notifiable; @@ -42,4 +43,9 @@ class User extends Authenticatable 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; + + public function canAccessPanel(Panel $panel): bool + { + return true; + } } diff --git a/docker-compose.yml b/docker-compose.yml index 9dadcd2..1b9579e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: extra_hosts: - 'host.docker.internal:host-gateway' ports: - - '${APP_PORT:-8080}:80' + - '${APP_PORT:-80}:80' environment: WWWUSER: '${WWWUSER:-1000}' LARAVEL_SAIL: 1