'decimal:8', 'longitude' => 'decimal:8', ]; public function user() { return $this->belongsTo(User::class); } public function location() { return $this->belongsTo(Location::class); } public function getPhotoUrlAttribute() { if ($this->photo) { return asset('storage/attendances/' . $this->photo); } return null; } public function scopeToday($query) { return $query->whereDate('date', today()); } public function scopeThisMonth($query) { return $query->whereMonth('date', now()->month) ->whereYear('date', now()->year); } public function scopeByDateRange($query, $startDate, $endDate) { return $query->whereBetween('date', [$startDate, $endDate]); } }