hasMany('App\Models\Release', 'categories_id'); } public function parent() { return $this->belongsTo(static::class, 'parentid'); } public function children() { return $this->hasMany(static::class, 'parentid'); } public function userExcludedCategory() { return $this->belongsTo('App\Models\UserExcludedCategory', 'categories_id'); } }