*/ use HasApiTokens, HasFactory, HasUlids, Notifiable; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'name', 'email', 'password', 'avatar_url', 'bio', 'daily_calorie_goal', 'daily_protein_goal', 'daily_carbs_goal', 'daily_fats_goal', ]; /** * The attributes that should be hidden for serialization. * * @var list */ protected $hidden = [ 'password', 'remember_token', ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'daily_calorie_goal' => 'integer', 'daily_protein_goal' => 'float', 'daily_carbs_goal' => 'float', 'daily_fats_goal' => 'float', ]; } public function deviceTokens(): HasMany { return $this->hasMany(DeviceToken::class); } public function routeNotificationForExpoPush(): array { return $this->deviceTokens() ->orderBy('id') ->pluck('expo_push_token') ->all(); } public function isAdmin() { return true; // return $this->role === 'admin'; } public function canAccessPanel(Panel $panel): bool { return true; } }