From 090ce6c474da3305abfedb6f3471f8214c1fba38 Mon Sep 17 00:00:00 2001 From: Ashley Shenton Date: Mon, 29 Jan 2024 14:19:29 +0000 Subject: [PATCH] fix: implement the filament user contract to allow access to the dashboard fix test email in README.md --- README.md | 2 +- app/Models/User.php | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5cf79ff4..f4afdad5 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Here are some useful quick links: To test out the v3 demo, you can log in to the [Cachet dashboard](https://v3.cachethq.io/dashboard) with the following credentials: -- **Email:** `test@example.com` +- **Email:** `test@test.com` - **Password:** `test123` > **Note** diff --git a/app/Models/User.php b/app/Models/User.php index bb834015..95888efc 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -12,12 +12,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; use HasFactory; @@ -53,4 +55,9 @@ class User extends Authenticatable 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; + + public function canAccessPanel(Panel $panel): bool + { + return true; + } }