*/ use HasFactory, Notifiable; protected $fillable = [ 'name', 'email', ]; protected $hidden = [ 'password', 'remember_token', ]; protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; } public function tracker(): HasOne { return $this->hasOne(Tracker::class); } public static function default(): self { return self::firstWhere('email', 'user@incr.local') ?? self::forceCreate([ 'email' => 'user@incr.local', 'name' => 'Default User', 'password' => bcrypt(Str::random(32)), ]); } public function hasCompletedOnboarding(): bool { return $this->hasEntries() && $this->hasMilestones(); } public function hasEntries(): bool { return (bool) $this->tracker?->entries()->exists(); } public function hasMilestones(): bool { return (bool) $this->tracker?->milestones()->exists(); } }