Skip to content

Commit

Permalink
Add production admin tule.
Browse files Browse the repository at this point in the history
  • Loading branch information
ijpatricio committed May 31, 2023
1 parent 65faa28 commit 6a7cbdc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .bash_history
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ php artisan make:filament-resource Donor/Donor --generate
php artisan forms:install
npm install && npm run dev
exit
mfs
a k:g
mfs
node -v
exit
12 changes: 11 additions & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
namespace App\Models;

// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Filament\Models\Contracts\FilamentUser;
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;

Expand Down Expand Up @@ -42,4 +43,13 @@ class User extends Authenticatable
'email_verified_at' => 'datetime',
'password' => 'hashed',
];

public function canAccessFilament(): bool
{
$adminEmails = [
'danielhe4rt@gmail.com',
];

return in_array($this->email, $adminEmails);
}
}

0 comments on commit 6a7cbdc

Please sign in to comment.