Skip to content

Commit

Permalink
Update User model to implement FilamentUser interface and add canAcce…
Browse files Browse the repository at this point in the history
…ssPanel method
  • Loading branch information
tobifra committed Aug 18, 2024
1 parent 8b89f6c commit 4eccaa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion api/app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
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;

class User extends Authenticatable
class User extends Authenticatable implements FilamentUser
{
use HasFactory, Notifiable;

Expand Down Expand Up @@ -44,4 +46,9 @@ protected function casts(): array
'password' => 'hashed',
];
}

public function canAccessPanel(Panel $panel): bool
{
return true;
}
}
2 changes: 1 addition & 1 deletion api/env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_NAME=Laravel
APP_NAME=Pfaditechnik
APP_ENV=production
APP_KEY=
APP_DEBUG=false
Expand Down

0 comments on commit 4eccaa7

Please sign in to comment.