<?php  namespace App\Models;  use App\Traits\HasStorage; use App\Traits\IsBillable; use App\Contracts\HasMedia; use Illuminate\Support\Str; use App\Traits\HasTranslations; use App\Observers\ProductObserver; use Illuminate\Database\Eloquent\Builder; use App\Http\Resources\ProductSingleResource; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Factories\HasFactory; use App\Contracts\HasTranslations as ContractsHasTranslations;  /**  * @property-read bool $use_parent_filters  */ class Product extends Model implements HasMedia, ContractsHasTranslations { 	use HasStorage, IsBillable, HasFactory, HasTranslations;  	protected $casts = [ 		'active' => 'boolean', 		'is_buyable' => 'boolean', 		'is_sold_out' => 'boolean', 		'archived' => 'boolean', 		'price' => 'double', 	];  	public function mediaConfig(): array{}  	public function isAvailable(): bool{}  	public function scopeIncludes(object $query, ?string $lang = null): Builder{}  	public function scopeDynamicFilters(Builder $query, ?array $filters = []): Builder{}  	public function scopeDynamicFilter(Builder $query, string $filter_id, array $values): Builder{}  	public function defaultTranslationLocale(): string{}  	public function scopeAvailable(Builder $query): Builder{}  	public function scopeNotArchived(Builder $query): Builder{}  	public function getItemEditRoute(): string{}  	public function category(): BelongsTo{}  	public function getSingleBillableResource(): ProductSingleResource{}  	public function getItemName(string $lang = 'en'): string{}  	public function orders(): HasMany{}  	public function productFilters(): HasMany{}  	public function saveFilterValues(?array $filters = []): self{}  	public function saveFilterTranslations(string $lang, ?array $filters = []): self{}  	public function scopeSearch(Builder $query, ?string $search = null): Builder{}  	public function scopeFilterSortBy(Builder $query, ?string $sort_by = null, ?string $fieldName = null): Builder{}  	public function scopeFilterPriceRange(Builder $query, ?int $price_min = null, ?int $price_max = null): Builder{}  	public function scopeFilterVolume(Builder $query, ?string $volume = null): Builder{}  	public function scopeFilterCategory(Builder $query, ?string $category = null): Builder{}  	public function setNameAttribute(string $value): void{}  	public function setSlugAttribute(?string $value): void{}  	public static function generateSlug(string $productTitle): string 	{ 		$original_slug = Str::slug($productTitle); 		$slug = '';  		// If slug exists 		if (self::where('slug', $original_slug)->exists()) { 			// Add UUID chunk to the end, untill it does not exist 			// if this chunk exists with this ID, try another chunk (won't happen but could happen) 			do { 				$uuid_chunk = explode('-', Str::uuid())[0]; 				$slug = $original_slug . '-' . $uuid_chunk; 			} while (self::where('slug', $slug)->exists()); 			$original_slug = $slug; 		}  		return $original_slug; 	}  	public function getPrice(): float{}  	protected static function initObservers(): ?string 	{ 		return ProductObserver::class; 	} }