'int', 'travel_country_id' => 'int', 'days_start' => 'int', 'days_duration' => 'int', 'min_persons' => 'int', 'price_adult' => 'float', 'price_children' => 'float', 'pos' => 'int', 'active' => 'bool' ]; protected $fillable = [ 'name', 'description', 'highlights', 'draft_type_id', 'travel_country_id', 'days_start', 'days_duration', 'min_persons', 'price_adult', 'price_children', 'pos', 'active' ]; public function travel_country() { return $this->belongsTo(TravelCountry::class); } public function i_q_travel_group_items() { return $this->hasMany(IQTravelGroupItem::class); } public function i_q_travel_item_places() { return $this->hasMany(IQTravelItemPlace::class)->orderBy('pos', 'ASC'); } public function draft_type() { return $this->belongsTo(DraftType::class, 'draft_type_id'); } //price_adult public function getPriceAdultAttribute() { return isset($this->attributes['price_adult']) ? Util::_number_format($this->attributes['price_adult']) : null; } public function setPriceAdultAttribute($value) { $this->attributes['price_adult'] = $value ? Util::_clean_float($value) : null; } public function getPriceAdultRaw() { return isset($this->attributes['price_adult']) ? $this->attributes['price_adult'] : 0; } public function setPriceAdultRaw($value) { return $this->attributes['price_adult'] = $value; } //price_children public function getPriceChildrenAttribute() { return isset($this->attributes['price_children']) ? Util::_number_format($this->attributes['price_children']) : null; } public function setPriceChildrenAttribute($value) { $this->attributes['price_children'] = $value ? Util::_clean_float($value) : null; } public function getPriceChildrenRaw() { return isset($this->attributes['price_children']) ? $this->attributes['price_children'] : 0; } public function setPriceChildrenRaw($value) { return $this->attributes['price_children'] = $value; } }