*/ protected $fillable = [ 'name', 'email', 'password', 'avatar_url', ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ]; public function getFilamentAvatar(): ?string { return $this->avatar_url; } public function getFilamentAvatarUrl(): ?string { return $this->avatar_url; } public function user_role() { return $this->belongsTo(UserRole::class, 'user_role_id'); } public function canAccessPanel(Panel $panel): bool { return str_ends_with($this->email, '@gmail.com') && $this->user_role_id == 1; } }