*/ protected $fillable = [ 'category_id', 'title', 'author', 'description', 'cover_image_path', 'file_path', 'tags', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'tags' => 'array', ]; /** * Get the category that owns the material. */ public function category() { return $this->belongsTo(Category::class); } }