'array', ]; protected $fillable = [ 'pos', 'product_id', 'category_id', 'show_on' ]; public function product() { return $this->belongsTo('App\Models\Product', 'product_id'); } public function category() { return $this->belongsTo('App\Models\Category', 'category_id'); } public function getShowOnTypes($seperator = false){ $ret = []; if($this->show_on && is_array($this->show_on)){ foreach($this->show_on as $show){ $ret[] = isset(Type::$showONs[$show]) ? Type::$showONs[$show] : '-'; } } return $seperator ? implode($seperator, $ret) : $ret; } }