hasMany(Config::class, 'category_id'); } public function delete() { $res = parent::delete(); $this->configs->each->delete(); return $res; } }