01 2022 Microsite Promotion

This commit is contained in:
Kevin Adametz 2022-01-18 18:30:14 +01:00
parent 3f1fb9377d
commit 38e7fd504a
39 changed files with 761 additions and 336 deletions

View file

@ -2,6 +2,7 @@
namespace App\Models;
use App\Services\Type;
use Illuminate\Database\Eloquent\Model;
use Cviebrock\EloquentSluggable\Sluggable;
@ -53,10 +54,10 @@ class Category extends Model
protected $table = 'categories';
protected $casts = ['trans_name' => 'array', 'trans_headline' => 'array'];
protected $casts = ['trans_name' => 'array', 'trans_headline' => 'array', 'show_on' => 'array'];
protected $fillable = [
'parent_id', 'name', 'headline', 'pos', 'active',
'parent_id', 'name', 'headline', 'pos', 'active', 'show_on'
];
public function sluggable()
@ -133,4 +134,15 @@ class Category extends Model
return rtrim($ret, ', ');
}
public function getShowOnTypes(){
$ret = [];
if(is_array($this->show_on)){
foreach($this->show_on as $show){
$ret[] = isset(Type::$showONs[$show]) ? Type::$showONs[$show] : '-';
}
}
return $ret;
}
}