id)->orderBy('name'); } public function deleteIfOrphaned(): void { if (DB::table('taggables')->where('tag_id', $this->id)->doesntExist()) { $this->delete(); } } public function applications() { return $this->morphedByMany(Application::class, 'taggable'); } public function services() { return $this->morphedByMany(Service::class, 'taggable'); } }