. */ namespace FireflyIII\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\Relations\MorphTo; /** * Class Location */ class Location extends Model { /** * The attributes that should be casted to native types. * * @var array */ protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', 'zoomLevel' => 'int', 'latitude' => 'float', 'longitude' => 'float', ]; /** @var array Fields that can be filled */ protected $fillable = ['locatable_id', 'locatable_type', 'latitude', 'longitude', 'zoom_level']; /** * @codeCoverageIgnore * Get all of the accounts. */ public function accounts(): MorphMany { return $this->morphMany(Account::class, 'noteable'); } /** * Get all of the owning attachable models. * * @codeCoverageIgnore * * @return MorphTo */ public function locatable(): MorphTo { return $this->morphTo(); } }