hasMany(Release::class, '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->hasMany(UserExcludedCategory::class, 'categories_id'); } public function roleExcludedCategory() { return $this->belongsTo(RoleExcludedCategory::class, 'categories_id'); } }