<?php  namespace App\Traits;  use App\Models\Tag; use App\Models\TagItem; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\MorphMany;  trait HasTags { 	public static function getTagDelimiter(): string 	{ 		return ' '; 	}  	protected static function bootHasTags(): void 	{ 		static::deleting(static function (object $model): void { 			$model->tags->each(static function (TagItem $item): void { 				$item->delete(); 			}); 		});  		static::deleted(static function (object $model): void { 			Tag::doesntHave('items') 				->get() 				->each(static function (Tag $item): void { 					$item->delete(); 				}); 		}); 	}  	public function tags(): MorphMany{}  	public function syncTagsByName(string|array|null $tags = null): self{}  	public function scopeSearchByTag(Builder $query, ?string $search = null): Builder{}  	public function scopeSearchByTagIds(Builder $query, ?array $tags = []): Builder{} }