attributes['entry_location'] = DB::raw("ST_SetSRID(ST_Point({$value['lng']}, {$value['lat']}), 4326)"); } public function setExitLocationAttribute($value) { $this->attributes['exit_location'] = DB::raw("ST_SetSRID(ST_Point({$value['lng']}, {$value['lat']}), 4326)"); } public function setOfficeLocationAttribute($value) { $this->attributes['office_location'] = DB::raw("ST_SetSRID(ST_Point({$value['lng']}, {$value['lat']}), 4326)"); } public function breaks() { return $this->hasMany(AttendanceBreak::class); } public $timestamps = true; }