*/ protected $allowedFields = [ 'zone_code', 'zone_name', 'latitude', 'longitude', 'radius_meters', 'is_active', ]; /** * Attributes that should be cast to specific types * * @var array */ protected $casts = [ 'id' => 'integer', 'latitude' => 'float', 'longitude' => 'float', 'radius_meters' => 'integer', 'is_active' => 'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; /** * Check if zone is active * * @return bool */ public function isActive(): bool { return (bool) $this->attributes['is_active']; } }