belongsTo(Category::class); } public function author() : BelongsTo { return $this->belongsTo(User::class, 'user_id'); } public function slide(): MorphOne { return $this->morphOne(Slide::class, 'slidable'); } protected $casts = [ 'content' => 'array', 'authors' => 'array', 'status' => PostStatus::class, 'images' => 'array' ]; }