Merge pull request #4371 from ashleyshenton/implement-filament-user

[3.x] Implement the filament user contract
This commit is contained in:
James Brooks
2024-01-29 16:15:19 +00:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@@ -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: 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` - **Password:** `test123`
> **Note** > **Note**

View File

@@ -12,12 +12,14 @@
namespace App\Models; namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail; // use Illuminate\Contracts\Auth\MustVerifyEmail;
use Filament\Models\Contracts\FilamentUser;
use Filament\Panel;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens; use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable class User extends Authenticatable implements FilamentUser
{ {
use HasApiTokens; use HasApiTokens;
use HasFactory; use HasFactory;
@@ -53,4 +55,9 @@ class User extends Authenticatable
'email_verified_at' => 'datetime', 'email_verified_at' => 'datetime',
'password' => 'hashed', 'password' => 'hashed',
]; ];
public function canAccessPanel(Panel $panel): bool
{
return true;
}
} }