diff --git a/.env.example b/.env.example index cc281953b..71f4ca1b5 100644 --- a/.env.example +++ b/.env.example @@ -28,9 +28,6 @@ REDIS_CACHE_HOST=redis REDIS_CACHE_PASSWORD=null REDIS_CACHE_PORT=6379 -SCOUT_DRIVER=database -SCOUT_QUEUE=false - EMAIL_HOST=mail.example.com EMAIL_PORT=587 EMAIL_ENCRYPTION=tls diff --git a/app/Casts/MetadataValue.php b/app/Casts/MetadataValue.php index 975107129..8be26c6ec 100644 --- a/app/Casts/MetadataValue.php +++ b/app/Casts/MetadataValue.php @@ -19,7 +19,7 @@ public function get($model, string $key, $value, array $attributes): mixed return match ($model->value_type->value) { MetadataType::BOOLEAN => (bool) $value, MetadataType::NUMBER => (float) $value, - default => $value + default => $value, }; } diff --git a/app/Console/Commands/RefreshProduct.php b/app/Console/Commands/RefreshProduct.php index df0163084..f55752c37 100644 --- a/app/Console/Commands/RefreshProduct.php +++ b/app/Console/Commands/RefreshProduct.php @@ -39,7 +39,6 @@ public function handle(): int $productService = app(ProductServiceContract::class); $productService->updateMinMaxPrices($product); - $product->searchable(); $this->info('Done.'); diff --git a/app/Criteria/MediaSearch.php b/app/Criteria/MediaSearch.php index e81f483ee..be460d6e3 100644 --- a/app/Criteria/MediaSearch.php +++ b/app/Criteria/MediaSearch.php @@ -10,10 +10,13 @@ class MediaSearch extends Criterion public function query(Builder $query): Builder { if ($this->value) { - $query->where('url', 'like', "%{$this->value}%") - ->orWhere('slug', 'like', "%{$this->value}%") - ->orWhere('alt', 'like', "%{$this->value}%") - ->orWhere('type', 'like', "%{$this->value}%"); + $query->where(function (Builder $query): void { + $query + ->where('url', 'like', "%{$this->value}%") + ->orWhere('slug', 'like', "%{$this->value}%") + ->orWhere('alt', 'like', "%{$this->value}%") + ->orWhere('type', 'like', "%{$this->value}%"); + }); } return $query; diff --git a/app/Criteria/ProductAttributeSearch.php b/app/Criteria/ProductAttributeSearch.php index c3af2d7c7..a80280ca8 100644 --- a/app/Criteria/ProductAttributeSearch.php +++ b/app/Criteria/ProductAttributeSearch.php @@ -22,7 +22,7 @@ public function query(Builder $query): Builder $query ->from('product_attribute_attribute_option') ->whereRaw( - '`product_attribute`.`id` = `product_attribute_attribute_option`.`product_attribute_id`' + '`product_attribute`.`id` = `product_attribute_attribute_option`.`product_attribute_id`', ); if (is_array($value)) { @@ -30,7 +30,7 @@ public function query(Builder $query): Builder 'attribute_options', 'product_attribute_attribute_option.attribute_option_id', '=', - 'attribute_options.id' + 'attribute_options.id', ); $key = is_numeric(Arr::first($value)) ? diff --git a/app/Criteria/ProductNotAttributeSearch.php b/app/Criteria/ProductNotAttributeSearch.php index f84a7d0f9..fee96caa9 100644 --- a/app/Criteria/ProductNotAttributeSearch.php +++ b/app/Criteria/ProductNotAttributeSearch.php @@ -22,7 +22,7 @@ public function query(Builder $query): Builder $query ->from('product_attribute_attribute_option') ->whereRaw( - '`product_attribute`.`id` = `product_attribute_attribute_option`.`product_attribute_id`' + '`product_attribute`.`id` = `product_attribute_attribute_option`.`product_attribute_id`', ); if (is_array($value)) { @@ -30,7 +30,7 @@ public function query(Builder $query): Builder 'attribute_options', 'product_attribute_attribute_option.attribute_option_id', '=', - 'attribute_options.id' + 'attribute_options.id', ); $key = is_numeric(Arr::first($value)) ? diff --git a/app/Criteria/ProductSearch.php b/app/Criteria/ProductSearch.php index 91afa5a15..7dbe8cf36 100644 --- a/app/Criteria/ProductSearch.php +++ b/app/Criteria/ProductSearch.php @@ -9,15 +9,12 @@ class ProductSearch extends Criterion { public function query(Builder $query): Builder { - if ($this->value === null) { - return $query; - } - - return $query->where(function (Builder $query): void { - $query->where('id', 'LIKE', '%' . $this->value . '%') - ->orWhere('slug', 'LIKE', '%' . $this->value . '%') - ->orWhere('name', 'LIKE', '%' . $this->value . '%') - ->orWhere('description_html', 'LIKE', '%' . $this->value . '%'); - }); + return $query->whereFullText([ + 'name', + 'slug', + 'description_html', + 'description_short', + 'search_values', + ], $this->value); } } diff --git a/app/Criteria/WhereHasBuyer.php b/app/Criteria/WhereHasBuyer.php index d758490fb..1093f98ba 100644 --- a/app/Criteria/WhereHasBuyer.php +++ b/app/Criteria/WhereHasBuyer.php @@ -16,13 +16,13 @@ public function query(Builder $query): Builder fn (Builder $query) => $query ->whereDoesntHave( 'status', - fn (Builder $query) => $query->where('cancel', '!=', false) + fn (Builder $query) => $query->where('cancel', '!=', false), ) ->whereHasMorph( 'buyer', $this->key === 'user' ? [User::class] : [App::class], fn (Builder $query) => $query->where('id', $this->value), - ) + ), ); } } diff --git a/app/Dtos/AttributeDto.php b/app/Dtos/AttributeDto.php index 552a1e023..29a14600b 100644 --- a/app/Dtos/AttributeDto.php +++ b/app/Dtos/AttributeDto.php @@ -26,7 +26,7 @@ public function __construct( ) {} public static function instantiateFromRequest( - AttributeStoreRequest|AttributeUpdateRequest|FormRequest $request + AttributeStoreRequest|AttributeUpdateRequest|FormRequest $request, ): self { return new self( id: $request->input('id', new Missing()), diff --git a/app/Dtos/BannerMediaDto.php b/app/Dtos/BannerMediaDto.php index 82e02b551..938de621f 100644 --- a/app/Dtos/BannerMediaDto.php +++ b/app/Dtos/BannerMediaDto.php @@ -22,7 +22,7 @@ public static function fromDataArray(array $data): self title: $data['title'] ?? null, subtitle: $data['subtitle'] ?? null, media: Collection::make($responsiveMedia) - ->map(fn ($media) => ResponsiveMediaDto::fromDataArray($media)) + ->map(fn ($media) => ResponsiveMediaDto::fromDataArray($media)), ); } diff --git a/app/Dtos/ConditionGroupDto.php b/app/Dtos/ConditionGroupDto.php index bb8b5151d..65056beeb 100644 --- a/app/Dtos/ConditionGroupDto.php +++ b/app/Dtos/ConditionGroupDto.php @@ -13,7 +13,7 @@ class ConditionGroupDto extends Dto public static function fromArray(array $array): self { return new self( - conditions: self::transformArrayToConditionDtos($array) + conditions: self::transformArrayToConditionDtos($array), ); } @@ -39,7 +39,7 @@ private static function transformArrayToConditionDtos(array $conditions): array ConditionType::WEEKDAY_IN => WeekDayInConditionDto::fromArray($condition), ConditionType::CART_LENGTH => CartLengthConditionDto::fromArray($condition), ConditionType::COUPONS_COUNT => CouponsCountConditionDto::fromArray($condition), - default => throw new Exception('Unknown condition type.') + default => throw new Exception('Unknown condition type.'), }; } diff --git a/app/Dtos/CouponDto.php b/app/Dtos/CouponDto.php index 0204f50e2..879b8f850 100644 --- a/app/Dtos/CouponDto.php +++ b/app/Dtos/CouponDto.php @@ -19,7 +19,7 @@ final class CouponDto extends SaleDto implements InstantiateFromRequest protected array|Missing $metadata; public static function instantiateFromRequest( - CouponCreateRequest|CouponUpdateRequest|FormRequest|SaleCreateRequest|StatusUpdateRequest $request + CouponCreateRequest|CouponUpdateRequest|FormRequest|SaleCreateRequest|StatusUpdateRequest $request, ): self { return new self( code: $request->input('code', new Missing()), diff --git a/app/Dtos/MediaAttachmentDto.php b/app/Dtos/MediaAttachmentDto.php index e4d1509c1..f8cf8f946 100644 --- a/app/Dtos/MediaAttachmentDto.php +++ b/app/Dtos/MediaAttachmentDto.php @@ -37,7 +37,7 @@ public static function instantiateFromRequest(FormRequest $request): self name: $request->input('name'), type: $type, visibility: $visibility, - description: $request->input('description') ?? new Missing() + description: $request->input('description') ?? new Missing(), ); } } diff --git a/app/Dtos/ProductSearchDto.php b/app/Dtos/ProductSearchDto.php index c17f07d97..f9fffbb97 100644 --- a/app/Dtos/ProductSearchDto.php +++ b/app/Dtos/ProductSearchDto.php @@ -11,7 +11,7 @@ class ProductSearchDto extends Dto implements InstantiateFromRequest { - private ?string $search; + private Missing|string $search; private ?string $sort; private array|Missing $ids; @@ -46,7 +46,7 @@ public static function instantiateFromRequest(FormRequest|ProductIndexRequest $r ? Str::replace('price:desc', 'price_max:desc', $sort) : $sort; return new self( - search: $request->input('search'), + search: $request->input('search', new Missing()), sort: $sort, ids: $request->input('ids', new Missing()), slug: $request->input('slug', new Missing()), @@ -66,30 +66,15 @@ public static function instantiateFromRequest(FormRequest|ProductIndexRequest $r metadata: self::array('metadata', $request), metadata_private: self::array('metadata_private', $request), price_min: $request->input('price.min', new Missing()), - price_max: $request->input('price.max', new Missing()) + price_max: $request->input('price.max', new Missing()), ); } - public function getSearch(): ?string - { - return $this->search; - } - public function getSort(): ?string { return $this->sort; } - public function getPriceMin(): float|Missing - { - return $this->price_min; - } - - public function getPriceMax(): float|Missing - { - return $this->price_max; - } - private static function boolean(string $key, FormRequest|ProductIndexRequest $request): bool|Missing { if (!$request->has($key)) { diff --git a/app/Dtos/ProductSetDto.php b/app/Dtos/ProductSetDto.php index d14f75d9d..2e1988741 100644 --- a/app/Dtos/ProductSetDto.php +++ b/app/Dtos/ProductSetDto.php @@ -31,7 +31,7 @@ public function __construct( * @throws DtoException */ public static function instantiateFromRequest( - FormRequest|ProductSetStoreRequest|ProductSetUpdateRequest $request + FormRequest|ProductSetStoreRequest|ProductSetUpdateRequest $request, ): self { return new self( id: $request->input('id') ?? new Missing(), diff --git a/app/Dtos/ProductSetUpdateDto.php b/app/Dtos/ProductSetUpdateDto.php index ce9ac8222..b61037579 100644 --- a/app/Dtos/ProductSetUpdateDto.php +++ b/app/Dtos/ProductSetUpdateDto.php @@ -23,7 +23,7 @@ class ProductSetUpdateDto extends Dto implements InstantiateFromRequest private array|Missing|null $attributes_ids; public static function instantiateFromRequest( - FormRequest|ProductSetStoreRequest|ProductSetUpdateRequest $request + FormRequest|ProductSetStoreRequest|ProductSetUpdateRequest $request, ): self { return new self( name: $request->input('name', new Missing()), diff --git a/app/Dtos/ProductsReorderDto.php b/app/Dtos/ProductsReorderDto.php index d6c975dc1..4ed9605d0 100644 --- a/app/Dtos/ProductsReorderDto.php +++ b/app/Dtos/ProductsReorderDto.php @@ -12,7 +12,7 @@ final class ProductsReorderDto extends Dto protected array|Missing $products; public static function instantiateFromRequest( - FormRequest|ProductSetProductReorderRequest $request + FormRequest|ProductSetProductReorderRequest $request, ): self { return new self( products: $request->input('products', new Missing()), diff --git a/app/Dtos/UserPreferencesDto.php b/app/Dtos/UserPreferencesDto.php index d595e33b7..44365eca7 100644 --- a/app/Dtos/UserPreferencesDto.php +++ b/app/Dtos/UserPreferencesDto.php @@ -24,7 +24,7 @@ public static function instantiateFromRequest(Request $request): self new_localization_login_alert: $request ->input('preferences.new_localization_login_alert', new Missing()), recovery_code_changed_alert: $request - ->input('preferences.recovery_code_changed_alert', new Missing()) + ->input('preferences.recovery_code_changed_alert', new Missing()), ); } diff --git a/app/Enums/ExceptionsEnums/Exceptions.php b/app/Enums/ExceptionsEnums/Exceptions.php index deea0f00f..2cf1b634f 100644 --- a/app/Enums/ExceptionsEnums/Exceptions.php +++ b/app/Enums/ExceptionsEnums/Exceptions.php @@ -144,7 +144,7 @@ public static function getCode(string $value): int self::SERVER_ERROR, self::SERVER_ORDER_STATUSES_NOT_CONFIGURED, self::SERVER_PAYMENT_MICROSERVICE_ERROR => 500, - default => 422 + default => 422, }; } } diff --git a/app/Events/ProductPriceUpdated.php b/app/Events/ProductPriceUpdated.php index c2e2f0082..185908ad7 100644 --- a/app/Events/ProductPriceUpdated.php +++ b/app/Events/ProductPriceUpdated.php @@ -9,11 +9,11 @@ class ProductPriceUpdated extends WebHookEvent private string $updatedAt; public function __construct( - private string $id, - private ?float $oldPriceMin, - private ?float $oldPriceMax, - private float $newPriceMin, - private float $newPriceMax, + private readonly string $id, + private readonly ?float $oldPriceMin, + private readonly ?float $oldPriceMax, + private readonly float $newPriceMin, + private readonly float $newPriceMax, ) { $this->updatedAt = Carbon::now()->toIso8601String(); parent::__construct(); diff --git a/app/Events/ProductSearchValueEvent.php b/app/Events/ProductSearchValueEvent.php new file mode 100644 index 000000000..6295e12d0 --- /dev/null +++ b/app/Events/ProductSearchValueEvent.php @@ -0,0 +1,16 @@ + [ 'field' => $data[0], ], - default => [] + default => [], }; } } diff --git a/app/Exceptions/ItemException.php b/app/Exceptions/ItemException.php index 9a408b883..5b3fa5d8b 100644 --- a/app/Exceptions/ItemException.php +++ b/app/Exceptions/ItemException.php @@ -9,7 +9,7 @@ class ItemException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/MediaCriticalException.php b/app/Exceptions/MediaCriticalException.php index 37d1155b0..974855eba 100644 --- a/app/Exceptions/MediaCriticalException.php +++ b/app/Exceptions/MediaCriticalException.php @@ -9,7 +9,7 @@ class MediaCriticalException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/MediaException.php b/app/Exceptions/MediaException.php index c770a3a1f..f5e09297a 100644 --- a/app/Exceptions/MediaException.php +++ b/app/Exceptions/MediaException.php @@ -9,7 +9,7 @@ class MediaException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/OrderException.php b/app/Exceptions/OrderException.php index c158160a8..768ec35a4 100644 --- a/app/Exceptions/OrderException.php +++ b/app/Exceptions/OrderException.php @@ -9,7 +9,7 @@ class OrderException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/PackageAuthException.php b/app/Exceptions/PackageAuthException.php index 512b9d02c..d06880573 100644 --- a/app/Exceptions/PackageAuthException.php +++ b/app/Exceptions/PackageAuthException.php @@ -9,7 +9,7 @@ class PackageAuthException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/RoleException.php b/app/Exceptions/RoleException.php index d4c89e210..533f18665 100644 --- a/app/Exceptions/RoleException.php +++ b/app/Exceptions/RoleException.php @@ -9,7 +9,7 @@ class RoleException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/StoreException.php b/app/Exceptions/StoreException.php index 812ebf087..40ded497a 100644 --- a/app/Exceptions/StoreException.php +++ b/app/Exceptions/StoreException.php @@ -32,7 +32,7 @@ public function logException(): void . '(code: ' . $this->getCode() . '): ' . $this->getMessage() . ' at ' . $this->getFile() - . ':(' . $this->getLine() . ')' + . ':(' . $this->getLine() . ')', ); } diff --git a/app/Exceptions/WebHookCreatorException.php b/app/Exceptions/WebHookCreatorException.php index 3a9533a90..010d1b3ae 100644 --- a/app/Exceptions/WebHookCreatorException.php +++ b/app/Exceptions/WebHookCreatorException.php @@ -9,7 +9,7 @@ class WebHookCreatorException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Exceptions/WebHookEventException.php b/app/Exceptions/WebHookEventException.php index 3c8cd29bd..58ca19a1b 100644 --- a/app/Exceptions/WebHookEventException.php +++ b/app/Exceptions/WebHookEventException.php @@ -9,7 +9,7 @@ class WebHookEventException extends StoreException public function __construct( string $message = '', int $code = 0, - ?Throwable $previous = null + ?Throwable $previous = null, ) { parent::__construct($message, $code, $previous); } diff --git a/app/Http/Controllers/AttributeController.php b/app/Http/Controllers/AttributeController.php index 9835d59cd..c4db2a9fa 100644 --- a/app/Http/Controllers/AttributeController.php +++ b/app/Http/Controllers/AttributeController.php @@ -30,7 +30,7 @@ public function index(AttributeIndexRequest $request): JsonResource ->with(['metadata', 'metadataPrivate']); return AttributeResource::collection( - $query->paginate(Config::get('pagination.per_page')) + $query->paginate(Config::get('pagination.per_page')), ); } @@ -42,7 +42,7 @@ public function show(Attribute $attribute): JsonResource public function store(AttributeStoreRequest $request): JsonResource { $attribute = $this->attributeService->create( - AttributeDto::instantiateFromRequest($request) + AttributeDto::instantiateFromRequest($request), ); return AttributeResource::make($attribute); @@ -52,7 +52,7 @@ public function update(Attribute $attribute, AttributeUpdateRequest $request): J { $attribute = $this->attributeService->update( $attribute, - AttributeDto::instantiateFromRequest($request) + AttributeDto::instantiateFromRequest($request), ); return AttributeResource::make($attribute); diff --git a/app/Http/Controllers/AttributeOptionController.php b/app/Http/Controllers/AttributeOptionController.php index 82896a23b..1c42ad700 100644 --- a/app/Http/Controllers/AttributeOptionController.php +++ b/app/Http/Controllers/AttributeOptionController.php @@ -34,7 +34,7 @@ public function index(AttributeOptionIndexRequest $request, Attribute $attribute ->with(['metadata', 'metadataPrivate']); return AttributeOptionResource::collection( - $query->paginate(Config::get('pagination.per_page')) + $query->paginate(Config::get('pagination.per_page')), ); } @@ -42,7 +42,7 @@ public function store(Attribute $attribute, AttributeOptionRequest $request): Js { $attributeOption = $this->attributeOptionService->create( $attribute->getKey(), - AttributeOptionDto::instantiateFromRequest($request) + AttributeOptionDto::instantiateFromRequest($request), ); return AttributeOptionResource::make($attributeOption); @@ -56,7 +56,7 @@ public function update(Attribute $attribute, AttributeOption $option, AttributeO $attributeOption = $this->attributeOptionService->updateOrCreate( $attribute->getKey(), - AttributeOptionDto::instantiateFromRequest($request) + AttributeOptionDto::instantiateFromRequest($request), ); return AttributeOptionResource::make($attributeOption); diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 3f362be4b..21c6bb1bf 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -92,7 +92,7 @@ public function showResetPasswordForm(?string $token = null, ?string $email = nu { $user = $this->authService->showResetPasswordForm( $email, - $token + $token, ); return UserResource::make($user); @@ -103,7 +103,7 @@ public function saveResetPassword(PasswordResetSaveRequest $request): JsonRespon $this->authService->saveResetPassword( $request->input('email'), $request->input('token'), - $request->input('password') + $request->input('password'), ); return Response::json(null, JsonResponse::HTTP_NO_CONTENT); @@ -116,7 +116,7 @@ public function changePassword(PasswordChangeRequest $request): JsonResponse $this->authService->changePassword( $user, $request->input('password'), - $request->input('password_new') + $request->input('password_new'), ); return Response::json(null, JsonResponse::HTTP_NO_CONTENT); @@ -160,7 +160,7 @@ public function setupTFA(TFASetupRequest $request): JsonResource public function confirmTFA(TFAConfirmRequest $request): JsonResource { return TFARecoveryCodesResource::make( - $this->authService->confirmTFA(TFAConfirmDto::instantiateFromRequest($request)) + $this->authService->confirmTFA(TFAConfirmDto::instantiateFromRequest($request)), ); } @@ -196,33 +196,33 @@ public function storeSavedAddress(SavedAddressStoreRequest $request, int $type): { $this->savedAddresService->storeAddress( SavedAddressDto::instantiateFromRequest($request), - $type + $type, ); return SavedAddressResource::collection( SavedAddress::where([ 'user_id' => Auth::id(), 'type' => $type, - ])->get() + ])->get(), ); } public function updateSavedAddress( SavedAddressUpdateRequest $request, SavedAddress $address, - int $type + int $type, ): JsonResource { $this->savedAddresService->updateAddress( $address, SavedAddressDto::instantiateFromRequest($request), - $type + $type, ); return SavedAddressResource::collection( SavedAddress::where([ 'user_id' => Auth::id(), 'type' => $type, - ])->get() + ])->get(), ); } @@ -234,7 +234,7 @@ public function deleteSavedAddress(SavedAddress $address, int $type): JsonResour SavedAddress::where([ 'user_id' => Auth::id(), 'type' => $type, - ])->get() + ])->get(), ); } diff --git a/app/Http/Controllers/BannerController.php b/app/Http/Controllers/BannerController.php index fb1147fea..5b7f86988 100644 --- a/app/Http/Controllers/BannerController.php +++ b/app/Http/Controllers/BannerController.php @@ -24,7 +24,7 @@ public function index(BannerIndexRequest $request): JsonResource ->with(['bannerMedia', 'bannerMedia.media', 'metadata', 'metadataPrivate']); return BannerResource::collection( - $query->paginate(Config::get('pagination.per_page')) + $query->paginate(Config::get('pagination.per_page')), ); } @@ -39,8 +39,8 @@ public function store(BannerStoreRequest $request): JsonResource { return BannerResource::make( $this->bannerService->create( - BannerDto::instantiateFromRequest($request) - ) + BannerDto::instantiateFromRequest($request), + ), ); } @@ -49,8 +49,8 @@ public function update(Banner $banner, BannerUpdateRequest $request): JsonResour return BannerResource::make( $this->bannerService->update( $banner, - BannerDto::instantiateFromRequest($request) - ) + BannerDto::instantiateFromRequest($request), + ), ); } diff --git a/app/Http/Controllers/FavouriteController.php b/app/Http/Controllers/FavouriteController.php index 068d936c3..06a217926 100644 --- a/app/Http/Controllers/FavouriteController.php +++ b/app/Http/Controllers/FavouriteController.php @@ -22,8 +22,8 @@ public function store(FavouriteProductSetStoreRequest $request): JsonResource { return FavouriteProductSetResource::make( $this->favouriteService->storeFavouriteProductSet( - FavouriteProductSetDto::instantiateFromRequest($request) - ) + FavouriteProductSetDto::instantiateFromRequest($request), + ), ); } diff --git a/app/Http/Controllers/FilterController.php b/app/Http/Controllers/FilterController.php index 6641c4e6c..4b2a770bd 100644 --- a/app/Http/Controllers/FilterController.php +++ b/app/Http/Controllers/FilterController.php @@ -16,10 +16,14 @@ public function indexBySetsIds(FilterIndexRequest $request): JsonResource } return AttributeResource::collection( - Attribute::whereHas( - 'productSets', - fn ($query) => $query->whereIn('product_set_id', $request->input('sets')), - )->orWhere('global', true)->with('options')->get() + Attribute::query() + ->whereHas( + 'productSets', + fn ($query) => $query->whereIn('product_set_id', $request->input('sets')), + ) + ->orWhere('global', true)->with('options') + ->orderBy('order') + ->get(), ); } } diff --git a/app/Http/Controllers/GoogleCategoryController.php b/app/Http/Controllers/GoogleCategoryController.php index 840eea629..9c3501ca2 100644 --- a/app/Http/Controllers/GoogleCategoryController.php +++ b/app/Http/Controllers/GoogleCategoryController.php @@ -12,7 +12,7 @@ class GoogleCategoryController extends Controller { public function __construct( - private readonly GoogleCategoryServiceContract $categoryService + private readonly GoogleCategoryServiceContract $categoryService, ) {} public function index(string $lang): JsonResource diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index dcab9f87f..156ddc179 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -44,7 +44,7 @@ public function show(Item $item): JsonResource public function store(ItemCreateRequest $request): JsonResource { $item = $this->itemService->store( - ItemDto::instantiateFromRequest($request) + ItemDto::instantiateFromRequest($request), ); return ItemResource::make($item); @@ -54,7 +54,7 @@ public function update(Item $item, ItemUpdateRequest $request): JsonResource { $item = $this->itemService->update( $item, - ItemDto::instantiateFromRequest($request) + ItemDto::instantiateFromRequest($request), ); return ItemResource::make($item); diff --git a/app/Http/Controllers/MetadataController.php b/app/Http/Controllers/MetadataController.php index c3c9ee810..a1fbf921e 100644 --- a/app/Http/Controllers/MetadataController.php +++ b/app/Http/Controllers/MetadataController.php @@ -35,7 +35,7 @@ public function updateOrCreate(int|string $modelId, Request $request): JsonResou $this->metadataService->updateOrCreate( $model, - $dto + $dto, ); } @@ -54,8 +54,8 @@ public function updateOrCreateLoggedMyPersonal(Request $request): JsonResource { return MetadataResource::make( $this->metadataService->updateOrCreateMyPersonal( - MetadataPersonalListDto::instantiateFromRequest($request) - ) + MetadataPersonalListDto::instantiateFromRequest($request), + ), ); } @@ -65,7 +65,7 @@ public function updateOrCreateUserPersonal(string $modelId, Request $request): J $this->metadataService->updateOrCreateUserPersonal( MetadataPersonalListDto::instantiateFromRequest($request), $modelId, - ) + ), ); } } diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index 9c25e19ff..6554d26df 100644 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -161,7 +161,7 @@ public function indexUserOrder(OrderIndexRequest $request): JsonResource Gate::inspect('indexUserOrder', [Order::class]); return OrderResource::collection( - $this->orderService->indexUserOrder(OrderIndexDto::instantiateFromRequest($request)) + $this->orderService->indexUserOrder(OrderIndexDto::instantiateFromRequest($request)), ); } @@ -175,7 +175,7 @@ public function showUserOrder(Order $order): JsonResource public function shippingLists(Order $order, OrderShippingListRequest $request): JsonResource { return OrderResource::make( - $this->orderService->shippingList($order, $request->package_template_id) + $this->orderService->shippingList($order, $request->package_template_id), ); } @@ -236,7 +236,7 @@ public function updateOrderProduct( public function myOrderProducts(OrderProductSearchRequest $request): JsonResource { return OrderProductResourcePublic::collection( - $this->orderService->indexMyOrderProducts(OrderProductSearchDto::instantiateFromRequest($request)) + $this->orderService->indexMyOrderProducts(OrderProductSearchDto::instantiateFromRequest($request)), ); } diff --git a/app/Http/Controllers/PackageTemplateController.php b/app/Http/Controllers/PackageTemplateController.php index 7142e4f98..709ab331a 100644 --- a/app/Http/Controllers/PackageTemplateController.php +++ b/app/Http/Controllers/PackageTemplateController.php @@ -29,8 +29,8 @@ public function store(PackageTemplateCreateRequest $request): JsonResource { return PackageTemplateResource::make( $this->packageTemplateService->store( - PackageTemplateDto::instantiateFromRequest($request) - ) + PackageTemplateDto::instantiateFromRequest($request), + ), ); } @@ -39,8 +39,8 @@ public function update(PackageTemplate $package, PackageTemplateUpdateRequest $r return PackageTemplateResource::make( $this->packageTemplateService->update( $package, - PackageTemplateDto::instantiateFromRequest($request) - ) + PackageTemplateDto::instantiateFromRequest($request), + ), ); } diff --git a/app/Http/Controllers/PaymentMethodController.php b/app/Http/Controllers/PaymentMethodController.php index b52022334..e9a8a9417 100644 --- a/app/Http/Controllers/PaymentMethodController.php +++ b/app/Http/Controllers/PaymentMethodController.php @@ -24,7 +24,7 @@ public function __construct( public function index(PaymentMethodIndexRequest $request): JsonResource { return PaymentMethodResource::collection( - $this->paymentMethodService->index(PaymentMethodIndexDto::instantiateFromRequest($request)) + $this->paymentMethodService->index(PaymentMethodIndexDto::instantiateFromRequest($request)), ); } diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index 6273b55d6..a791ab0d2 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -17,7 +17,7 @@ use App\Http\Resources\ResourceCollection; use App\Models\MediaAttachment; use App\Models\Product; -use App\Repositories\Contracts\ProductRepositoryContract; +use App\Repositories\ProductRepository; use App\Services\Contracts\MediaAttachmentServiceContract; use App\Services\Contracts\ProductServiceContract; use Illuminate\Http\JsonResponse; @@ -29,9 +29,9 @@ class ProductController extends Controller { public function __construct( - private ProductServiceContract $productService, - private ProductRepositoryContract $productRepository, - private MediaAttachmentServiceContract $attachmentService, + private readonly ProductRepository $productRepository, + private readonly ProductServiceContract $productService, + private readonly MediaAttachmentServiceContract $attachmentService, ) {} public function index(ProductIndexRequest $request): JsonResource diff --git a/app/Http/Controllers/SchemaController.php b/app/Http/Controllers/SchemaController.php index 025ce08a7..ce68b02ed 100644 --- a/app/Http/Controllers/SchemaController.php +++ b/app/Http/Controllers/SchemaController.php @@ -33,7 +33,7 @@ public function index(IndexSchemaRequest $request): JsonResource public function store(SchemaStoreRequest $request): JsonResource { return SchemaResource::make($this->schemaService->store( - SchemaDto::instantiateFromRequest($request) + SchemaDto::instantiateFromRequest($request), )); } @@ -46,7 +46,7 @@ public function update(SchemaUpdateRequest $request, Schema $schema): JsonResour { return SchemaResource::make($this->schemaService->update( $schema, - SchemaDto::instantiateFromRequest($request) + SchemaDto::instantiateFromRequest($request), )); } diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php index 9e7f774ac..6fe86ecbd 100644 --- a/app/Http/Controllers/StatusController.php +++ b/app/Http/Controllers/StatusController.php @@ -27,14 +27,14 @@ public function index(StatusIndexRequest $request): JsonResource ->with(['metadata']); return StatusResource::collection( - $statuses->orderBy('order')->get() + $statuses->orderBy('order')->get(), ); } public function store(StatusCreateRequest $request): JsonResource { return StatusResource::make( - $this->statusService->store(StatusDto::instantiateFromRequest($request)) + $this->statusService->store(StatusDto::instantiateFromRequest($request)), ); } @@ -43,8 +43,8 @@ public function update(Status $status, StatusUpdateRequest $request): JsonResour return StatusResource::make( $this->statusService->update( $status, - StatusDto::instantiateFromRequest($request) - ) + StatusDto::instantiateFromRequest($request), + ), ); } diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 52809fdb1..a2a7dbb12 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -2,14 +2,14 @@ namespace App\Http\Controllers; +use App\Events\ProductSearchValueEvent; use App\Http\Requests\TagCreateRequest; use App\Http\Requests\TagIndexRequest; use App\Http\Requests\TagUpdateRequest; use App\Http\Resources\TagResource; -use App\Models\Product; use App\Models\Tag; -use Illuminate\Http\JsonResponse; use Illuminate\Http\Resources\Json\JsonResource; +use Illuminate\Http\Response as HttpResponse; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Response; @@ -35,21 +35,17 @@ public function store(TagCreateRequest $request): JsonResource public function update(Tag $tag, TagUpdateRequest $request): JsonResource { $tag->update($request->validated()); - - // @phpstan-ignore-next-line - $tag->products()->searchable(); + ProductSearchValueEvent::dispatch($tag->products->pluck('id')->toArray()); return TagResource::make($tag); } - public function destroy(Tag $tag): JsonResponse + public function destroy(Tag $tag): HttpResponse { - $productsIds = $tag->products()->pluck('id'); + $products = $tag->products->pluck('id')->toArray(); $tag->delete(); + ProductSearchValueEvent::dispatch($products); - // @phpstan-ignore-next-line - Product::query()->whereIn('id', $productsIds)->searchable(); - - return Response::json(null, 204); + return Response::noContent(); } } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 6f1b1b51d..6f5a8cea6 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -55,7 +55,7 @@ public function show(User $user): JsonResource public function store(UserCreateRequest $request): JsonResource { $user = $this->userService->create( - UserCreateDto::instantiateFromRequest($request) + UserCreateDto::instantiateFromRequest($request), ); return UserResource::make($user); @@ -65,7 +65,7 @@ public function update(User $user, UserUpdateRequest $request): JsonResource { $resultUser = $this->userService->update( $user, - UserDto::instantiateFromRequest($request) + UserDto::instantiateFromRequest($request), ); return UserResource::make($resultUser); diff --git a/app/Http/Requests/AppStoreRequest.php b/app/Http/Requests/AppStoreRequest.php index 8bd9393b1..17d222d0f 100644 --- a/app/Http/Requests/AppStoreRequest.php +++ b/app/Http/Requests/AppStoreRequest.php @@ -25,7 +25,7 @@ public function rules(): array 'allowed_permissions.*' => ['string'], 'public_app_permissions' => ['present', 'array'], 'public_app_permissions.*' => ['string'], - ] + ], ); } } diff --git a/app/Http/Requests/AttributeOptionRequest.php b/app/Http/Requests/AttributeOptionRequest.php index ec5873545..f575a74dc 100644 --- a/app/Http/Requests/AttributeOptionRequest.php +++ b/app/Http/Requests/AttributeOptionRequest.php @@ -28,7 +28,7 @@ public function rules(): array 'name' => [$nameRule, 'string', 'max:255'], 'value_number' => ['nullable', 'numeric', 'regex:/^\d{1,6}(\.\d{1,2}|)$/'], 'value_date' => ['nullable', 'date'], - ] + ], ); } } diff --git a/app/Http/Requests/AttributeStoreRequest.php b/app/Http/Requests/AttributeStoreRequest.php index 82d585b74..5cd115529 100644 --- a/app/Http/Requests/AttributeStoreRequest.php +++ b/app/Http/Requests/AttributeStoreRequest.php @@ -35,7 +35,7 @@ public function rules(): array 'type' => ['required', new Enum(AttributeType::class)], 'global' => ['required', 'boolean'], 'sortable' => ['required', 'boolean'], - ] + ], ); } } diff --git a/app/Http/Requests/BannerStoreRequest.php b/app/Http/Requests/BannerStoreRequest.php index 9c5ae1173..6183592b4 100644 --- a/app/Http/Requests/BannerStoreRequest.php +++ b/app/Http/Requests/BannerStoreRequest.php @@ -25,7 +25,7 @@ public function rules(): array 'banner_media.*.media' => ['required', 'array'], 'banner_media.*.media.*.min_screen_width' => ['required', 'numeric'], 'banner_media.*.media.*.media' => ['required', 'uuid', 'exists:media,id'], - ] + ], ); } } diff --git a/app/Http/Requests/OrderCreateRequest.php b/app/Http/Requests/OrderCreateRequest.php index d9754c737..fc9f298b8 100644 --- a/app/Http/Requests/OrderCreateRequest.php +++ b/app/Http/Requests/OrderCreateRequest.php @@ -45,7 +45,7 @@ public function rules(): array ], 'invoice_requested' => ['boolean'], - ] + ], ); } } diff --git a/app/Http/Requests/PackageTemplateCreateRequest.php b/app/Http/Requests/PackageTemplateCreateRequest.php index 90438fc4f..73d97125b 100644 --- a/app/Http/Requests/PackageTemplateCreateRequest.php +++ b/app/Http/Requests/PackageTemplateCreateRequest.php @@ -19,7 +19,7 @@ public function rules(): array 'width' => ['required', 'integer'], 'height' => ['required', 'integer'], 'depth' => ['required', 'integer'], - ] + ], ); } } diff --git a/app/Http/Requests/ProductIndexRequest.php b/app/Http/Requests/ProductIndexRequest.php index b7c25108f..2b9c470e7 100644 --- a/app/Http/Requests/ProductIndexRequest.php +++ b/app/Http/Requests/ProductIndexRequest.php @@ -21,7 +21,7 @@ public function rules(): array } return [ - 'search' => ['nullable', 'string', 'max:255'], + 'search' => ['sometimes', 'string', 'max:255'], 'ids' => ['array'], 'ids.*' => ['uuid'], diff --git a/app/Http/Requests/RoleStoreRequest.php b/app/Http/Requests/RoleStoreRequest.php index df8e54cdf..eca37ad42 100644 --- a/app/Http/Requests/RoleStoreRequest.php +++ b/app/Http/Requests/RoleStoreRequest.php @@ -20,7 +20,7 @@ public function rules(): array 'permissions' => ['array'], 'permissions.*' => ['string'], 'is_joinable' => ['boolean'], - ] + ], ); } } diff --git a/app/Http/Requests/SaleCreateRequest.php b/app/Http/Requests/SaleCreateRequest.php index 72d908cb6..e97be9c82 100644 --- a/app/Http/Requests/SaleCreateRequest.php +++ b/app/Http/Requests/SaleCreateRequest.php @@ -71,7 +71,7 @@ function ($input, $item) { ConditionType::MAX_USES, ConditionType::MAX_USES_PER_USER, ]); - } + }, ); $validator->sometimes( @@ -85,7 +85,7 @@ function ($input, $item) { ConditionType::USER_IN, ConditionType::USER_IN_ROLE, ]); - } + }, ); $validator->sometimes( @@ -98,7 +98,7 @@ function ($input, $item) { ConditionType::DATE_BETWEEN, ConditionType::TIME_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -109,7 +109,7 @@ function ($input, $item) { ->in([ ConditionType::ORDER_VALUE, ]); - } + }, ); $validator->sometimes( @@ -120,7 +120,7 @@ function ($input, $item) { ->in([ ConditionType::ORDER_VALUE, ]); - } + }, ); $validator->sometimes( @@ -135,7 +135,7 @@ function ($input, $item) { ->in([ ConditionType::ORDER_VALUE, ]); - } + }, ); $validator->sometimes( @@ -146,7 +146,7 @@ function ($input, $item) { ->in([ ConditionType::TIME_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -157,7 +157,7 @@ function ($input, $item) { ->in([ ConditionType::TIME_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -168,7 +168,7 @@ function ($input, $item) { ->in([ ConditionType::DATE_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -183,7 +183,7 @@ function ($input, $item) { ->in([ ConditionType::DATE_BETWEEN, ]); - } + }, ); $validator->sometimes( @@ -194,7 +194,7 @@ function ($input, $item) { ->in([ ConditionType::WEEKDAY_IN, ]); - } + }, ); $validator->sometimes( @@ -205,7 +205,7 @@ function ($input, $item) { ->in([ ConditionType::USER_IN_ROLE, ]); - } + }, ); $validator->sometimes( @@ -216,7 +216,7 @@ function ($input, $item) { ->in([ ConditionType::USER_IN, ]); - } + }, ); $validator->sometimes( @@ -227,7 +227,7 @@ function ($input, $item) { ->in([ ConditionType::PRODUCT_IN, ]); - } + }, ); $validator->sometimes( @@ -238,7 +238,7 @@ function ($input, $item) { ->in([ ConditionType::PRODUCT_IN_SET, ]); - } + }, ); $validator->sometimes( @@ -250,7 +250,7 @@ function ($input, $item) { ConditionType::CART_LENGTH, ConditionType::COUPONS_COUNT, ]); - } + }, ); $validator->sometimes( @@ -266,7 +266,7 @@ function ($input, $item) { ConditionType::CART_LENGTH, ConditionType::COUPONS_COUNT, ]); - } + }, ); } } diff --git a/app/Http/Requests/SchemaStoreRequest.php b/app/Http/Requests/SchemaStoreRequest.php index 2386cd09c..4e83cd18d 100644 --- a/app/Http/Requests/SchemaStoreRequest.php +++ b/app/Http/Requests/SchemaStoreRequest.php @@ -39,7 +39,7 @@ public function rules(): array 'options.*.items' => ['nullable', 'array'], 'options.*.items.*' => ['uuid', 'exists:items,id'], - ] + ], ); } } diff --git a/app/Http/Requests/StatusCreateRequest.php b/app/Http/Requests/StatusCreateRequest.php index 38d5e7e2e..da4a58f83 100644 --- a/app/Http/Requests/StatusCreateRequest.php +++ b/app/Http/Requests/StatusCreateRequest.php @@ -20,7 +20,7 @@ public function rules(): array 'description' => ['string', 'max:255', 'nullable'], 'hidden' => ['boolean'], 'no_notifications' => ['boolean'], - ] + ], ); } } diff --git a/app/Http/Resources/OrderProductResource.php b/app/Http/Resources/OrderProductResource.php index 883a0cca3..7cd80bb31 100644 --- a/app/Http/Resources/OrderProductResource.php +++ b/app/Http/Resources/OrderProductResource.php @@ -26,7 +26,7 @@ public function base(Request $request): array 'sets' => ProductSetResource::collection( Gate::denies('product_sets.show_hidden') ? $this->resource->product->sets->where('public', true) - : $this->resource->product->sets + : $this->resource->product->sets, ), ], ]; diff --git a/app/Http/Resources/ProductResource.php b/app/Http/Resources/ProductResource.php index 91f56ca9c..79b3aa2a2 100644 --- a/app/Http/Resources/ProductResource.php +++ b/app/Http/Resources/ProductResource.php @@ -49,13 +49,13 @@ public function view(Request $request): array { $sets = Gate::denies('product_sets.show_hidden') ? $this->resource->sets->filter( - fn (ProductSet $set) => $set->public === true && $set->public_parent === true + fn (ProductSet $set) => $set->public === true && $set->public_parent === true, ) : $this->resource->sets; $relatedSets = Gate::denies('product_sets.show_hidden') ? $this->resource->relatedSets->filter( - fn (ProductSet $set) => $set->public === true && $set->public_parent === true + fn (ProductSet $set) => $set->public === true && $set->public_parent === true, ) : $this->resource->relatedSets; diff --git a/app/Listeners/ItemUpdatedQuantityListener.php b/app/Listeners/ItemUpdatedQuantityListener.php index c4e2683eb..38b37d160 100644 --- a/app/Listeners/ItemUpdatedQuantityListener.php +++ b/app/Listeners/ItemUpdatedQuantityListener.php @@ -4,20 +4,15 @@ use App\Events\ItemUpdatedQuantity; use App\Services\Contracts\AvailabilityServiceContract; -use App\Services\Contracts\ItemServiceContract; final readonly class ItemUpdatedQuantityListener { public function __construct( private AvailabilityServiceContract $availabilityService, - private ItemServiceContract $itemServiceContract, ) {} public function handle(ItemUpdatedQuantity $event): void { $this->availabilityService->calculateItemAvailability($event->getItem()); - - // TODO: remove this with elastic refactor - $this->itemServiceContract->refreshSearchable($event->getItem()); } } diff --git a/app/Listeners/MakeSetProductsSearchable.php b/app/Listeners/MakeSetProductsSearchable.php deleted file mode 100644 index 17effaba4..000000000 --- a/app/Listeners/MakeSetProductsSearchable.php +++ /dev/null @@ -1,22 +0,0 @@ -productSetService->indexAllProducts($event->getProductSet()); - } -} diff --git a/app/Listeners/ProductSearchValueListener.php b/app/Listeners/ProductSearchValueListener.php new file mode 100644 index 000000000..0846b11d4 --- /dev/null +++ b/app/Listeners/ProductSearchValueListener.php @@ -0,0 +1,18 @@ +productService->updateProductsSearchValues($event->product_ids); + } +} diff --git a/app/Models/App.php b/app/Models/App.php index 2d3fa8753..6de785c4c 100644 --- a/app/Models/App.php +++ b/app/Models/App.php @@ -108,7 +108,7 @@ public function shippingMethods(): HasMany public function hasRole( array|Collection|int|\Spatie\Permission\Contracts\Role|string $roles, - ?string $guard = null + ?string $guard = null, ): bool { return false; } diff --git a/app/Models/AttributeOption.php b/app/Models/AttributeOption.php index 78796e0fc..04fa89681 100644 --- a/app/Models/AttributeOption.php +++ b/app/Models/AttributeOption.php @@ -11,6 +11,7 @@ use Heseya\Searchable\Traits\HasCriteria; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\SoftDeletes; /** @@ -50,4 +51,14 @@ public function attribute(): BelongsTo { return $this->belongsTo(Attribute::class); } + + public function productAttributes(): BelongsToMany + { + return $this->belongsToMany( + ProductAttribute::class, + 'product_attribute_attribute_option', + 'attribute_option_id', + 'product_attribute_id', + ); + } } diff --git a/app/Models/Contracts/SortableContract.php b/app/Models/Contracts/SortableContract.php index a2aebc6e9..ae89a1f8b 100644 --- a/app/Models/Contracts/SortableContract.php +++ b/app/Models/Contracts/SortableContract.php @@ -6,11 +6,7 @@ interface SortableContract { - public function scopeSort(Builder $query, ?string $sortString = null): Builder|\Laravel\Scout\Builder; + public function scopeSort(Builder $query, ?string $sortString = null): Builder; public function getSortable(): array; - - public function getDefaultSortBy(): string; - - public function getDefaultSortDirection(): string; } diff --git a/app/Models/Discount.php b/app/Models/Discount.php index 8ec1e0363..11531c29e 100644 --- a/app/Models/Discount.php +++ b/app/Models/Discount.php @@ -85,7 +85,7 @@ public function products(): MorphToMany return $this->morphedByMany( Product::class, 'model', - 'model_has_discounts' + 'model_has_discounts', )->with(['metadata', 'metadataPrivate', 'attributes', 'media', 'tags']); } @@ -94,7 +94,7 @@ public function productSets(): MorphToMany return $this->morphedByMany( ProductSet::class, 'model', - 'model_has_discounts' + 'model_has_discounts', )->with(['metadata', 'metadataPrivate']); } diff --git a/app/Models/DiscountCondition.php b/app/Models/DiscountCondition.php index e9cf69bf7..11853fe27 100644 --- a/app/Models/DiscountCondition.php +++ b/app/Models/DiscountCondition.php @@ -31,7 +31,7 @@ public function getValueAttribute(string $value): array if ($this->type->is(ConditionType::WEEKDAY_IN)) { $value['weekday'] = array_map( fn (string $key) => (bool) $key, - mb_str_split(sprintf('%07d', decbin($value['weekday']))) + mb_str_split(sprintf('%07d', decbin($value['weekday']))), ); } @@ -57,7 +57,7 @@ public function products(): MorphToMany return $this->morphedByMany( Product::class, 'model', - 'model_has_discount_conditions' + 'model_has_discount_conditions', ); } @@ -66,7 +66,7 @@ public function productSets(): MorphToMany return $this->morphedByMany( ProductSet::class, 'model', - 'model_has_discount_conditions' + 'model_has_discount_conditions', ); } @@ -75,7 +75,7 @@ public function users(): MorphToMany return $this->morphedByMany( User::class, 'model', - 'model_has_discount_conditions' + 'model_has_discount_conditions', ); } @@ -84,7 +84,7 @@ public function roles(): MorphToMany return $this->morphedByMany( Role::class, 'model', - 'model_has_discount_conditions' + 'model_has_discount_conditions', ); } diff --git a/app/Models/Order.php b/app/Models/Order.php index 2635b6a71..1d4d71fc1 100644 --- a/app/Models/Order.php +++ b/app/Models/Order.php @@ -114,9 +114,6 @@ class Order extends Model implements AuditableContract, SortableContract 'summary', ]; - protected string $defaultSortBy = 'created_at'; - protected string $defaultSortDirection = 'desc'; - protected $casts = [ 'paid' => 'boolean', 'invoice_requested' => 'boolean', diff --git a/app/Models/Product.php b/app/Models/Product.php index a434002bd..9a6c82ccd 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -19,7 +19,6 @@ use App\Criteria\WhereNotSlug; use App\Enums\DiscountTargetType; use App\Models\Contracts\SortableContract; -use App\Services\Contracts\ProductSearchServiceContract; use App\Traits\HasDiscountConditions; use App\Traits\HasDiscounts; use App\Traits\HasMediaAttachments; @@ -34,11 +33,6 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Support\Collection; -use JeroenG\Explorer\Application\Explored; -use JeroenG\Explorer\Application\SearchableFields; -use JeroenG\Explorer\Domain\Analysis\Analysis; -use JeroenG\Explorer\Domain\Analysis\Analyzer\StandardAnalyzer; -use Laravel\Scout\Searchable; use OwenIt\Auditing\Auditable; use OwenIt\Auditing\Contracts\Auditable as AuditableContract; @@ -47,7 +41,7 @@ * * @mixin IdeHelperProduct */ -class Product extends Model implements AuditableContract, Explored, SearchableFields, SortableContract +class Product extends Model implements AuditableContract, SortableContract { use Auditable; use HasCriteria; @@ -57,7 +51,6 @@ class Product extends Model implements AuditableContract, Explored, SearchableFi use HasMediaAttachments; use HasMetadata; use HasSeoMetadata; - use Searchable; use SoftDeletes; use Sortable; @@ -83,7 +76,9 @@ class Product extends Model implements AuditableContract, Explored, SearchableFi 'quantity', 'shipping_digital', 'purchase_limit_per_user', + 'search_values', ]; + protected array $auditInclude = [ 'name', 'slug', @@ -95,6 +90,7 @@ class Product extends Model implements AuditableContract, Explored, SearchableFi 'price_max', 'available', ]; + protected $casts = [ 'shipping_date' => 'date', 'price' => 'float', @@ -107,6 +103,7 @@ class Product extends Model implements AuditableContract, Explored, SearchableFi 'shipping_digital' => 'bool', 'purchase_limit_per_user' => 'float', ]; + protected array $sortable = [ 'id', 'price', @@ -120,6 +117,7 @@ class Product extends Model implements AuditableContract, Explored, SearchableFi 'attribute.*', 'set.*', ]; + protected array $criteria = [ 'search' => ProductSearch::class, 'ids' => WhereInIds::class, @@ -142,39 +140,6 @@ class Product extends Model implements AuditableContract, Explored, SearchableFi 'has_schemas' => WhereHasSchemas::class, 'shipping_digital' => Equals::class, ]; - protected string $defaultSortBy = 'products.created_at'; - protected string $defaultSortDirection = 'desc'; - - public function mappableAs(): array - { - $searchService = app(ProductSearchServiceContract::class); - - return $searchService->mappableAs(); - } - - public function toSearchableArray(): array - { - $searchService = app(ProductSearchServiceContract::class); - - return $searchService->mapSearchableArray($this); - } - - public function getSearchableFields(): array - { - $searchService = app(ProductSearchServiceContract::class); - - return $searchService->searchableFields(); - } - - public function indexSettings(): array - { - $analyzer = new StandardAnalyzer('morfologik'); - $analyzer->setFilters(['lowercase', 'morfologik_stem']); - - return (new Analysis()) - ->addAnalyzer($analyzer) - ->build(); - } public function sets(): BelongsToMany { @@ -266,7 +231,7 @@ public function allProductSales(Collection $salesWithBlockList): Collection fn (Discount $discount): bool => $discount->code === null && $discount->active && $discount->target_type->is(DiscountTargetType::PRODUCTS) - && $discount->target_is_allow_list + && $discount->target_is_allow_list, ); $salesBlockList = $salesWithBlockList->filter(function ($sale): bool { diff --git a/app/Models/ProductSet.php b/app/Models/ProductSet.php index dca004832..74f6f28dd 100644 --- a/app/Models/ProductSet.php +++ b/app/Models/ProductSet.php @@ -146,6 +146,11 @@ public function products(): BelongsToMany ->orderByPivot('order'); } + public function relatedProducts(): BelongsToMany + { + return $this->belongsToMany(Product::class, 'related_product_sets'); + } + public function allProductsIds(): Collection { $products = $this->products()->pluck('id'); diff --git a/app/Models/WebHook.php b/app/Models/WebHook.php index cf55d8992..3991e949f 100644 --- a/app/Models/WebHook.php +++ b/app/Models/WebHook.php @@ -62,9 +62,6 @@ class WebHook extends Model implements AuditableContract, SortableContract 'updated_at', ]; - protected string $defaultSortBy = 'created_at'; - protected string $defaultSortDirection = 'desc'; - public function logs(): HasMany { return $this->hasMany(WebHookEventLogEntry::class); diff --git a/app/Payments/PayU.php b/app/Payments/PayU.php index e096ee828..c6447b765 100644 --- a/app/Payments/PayU.php +++ b/app/Payments/PayU.php @@ -75,7 +75,7 @@ public static function translateNotification(Request $request): JsonResponse $request->getContent(), $signature['signature'], Config::get('payu.second_key'), - $signature['algorithm'] + $signature['algorithm'], )) { throw new ClientException(Exceptions::CLIENT_UNTRUSTED_NOTIFICATION); } diff --git a/app/Policies/WebHookPolicy.php b/app/Policies/WebHookPolicy.php index c024303b2..d25c22b0b 100644 --- a/app/Policies/WebHookPolicy.php +++ b/app/Policies/WebHookPolicy.php @@ -31,7 +31,7 @@ public function update(App|User $user, WebHook $webHook, array $newWebHook): Res $newWebHook['events'] ?? $webHook->events, $newWebHook['with_issuer'] ?? $webHook->with_issuer, $newWebHook['with_hidden'] ?? $webHook->with_hidden, - $user + $user, ); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 8a5154adf..b7df87eb4 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,7 +2,6 @@ namespace App\Providers; -use App\Models\Product; use App\Services\AnalyticsService; use App\Services\AppService; use App\Services\AttributeOptionService; @@ -107,7 +106,6 @@ use App\Services\WishlistService; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\ServiceProvider; -use Laravel\Scout\Builder; class AppServiceProvider extends ServiceProvider { @@ -187,18 +185,4 @@ public function register(): void $this->app->register('\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider'); } } - - public function boot(): void - { - Builder::macro('sort', function (?string $sortString = null) { - if ($sortString !== null) { - // @phpstan-ignore-next-line - return app(SortServiceContract::class)->sort($this, $sortString); - } - - return $this; - }); - - Product::disableSearchSyncing(); - } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index e0fda148c..5db220444 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -25,6 +25,7 @@ use App\Events\ProductCreated; use App\Events\ProductDeleted; use App\Events\ProductPriceUpdated; +use App\Events\ProductSearchValueEvent; use App\Events\ProductSetCreated; use App\Events\ProductSetDeleted; use App\Events\ProductSetUpdated; @@ -42,9 +43,9 @@ use App\Events\UserDeleted; use App\Events\UserUpdated; use App\Listeners\ItemUpdatedQuantityListener; -use App\Listeners\MakeSetProductsSearchable; use App\Listeners\OrderCreatedListener; use App\Listeners\OrderUpdatedStatusListener; +use App\Listeners\ProductSearchValueListener; use App\Listeners\UserCreatedListener; use App\Listeners\WebHookEventListener; use App\Listeners\WebHookFailedListener; @@ -84,15 +85,12 @@ class EventServiceProvider extends ServiceProvider ItemUpdatedQuantity::class => [ ItemUpdatedQuantityListener::class, ], - ProductSetCreated::class => [ - MakeSetProductsSearchable::class, - ], - ProductSetUpdated::class => [ - MakeSetProductsSearchable::class, - ], UserCreated::class => [ UserCreatedListener::class, ], + ProductSearchValueEvent::class => [ + ProductSearchValueListener::class, + ], ]; /** @var array */ diff --git a/app/Providers/RepositoryServiceProvider.php b/app/Providers/RepositoryServiceProvider.php deleted file mode 100644 index e2602e7ab..000000000 --- a/app/Providers/RepositoryServiceProvider.php +++ /dev/null @@ -1,36 +0,0 @@ - EloquentProductRepository::class, - ]; - - private const ELASTIC = [ - ProductRepositoryContract::class => ElasticProductRepository::class, - ]; - - public function register(): void - { - $forceDatabase = request()->boolean('force_database_search'); - - $contracts = match ($forceDatabase ? 'database' : Config::get('scout.driver')) { - 'elastic' => self::ELASTIC, - 'database' => self::ELOQUENT, - default => throw new Exception('Invalid scout driver "' . Config::get('scout.driver') . '"'), - }; - - foreach ($contracts as $abstract => $concrete) { - $this->app->bind($abstract, $concrete); - } - } -} diff --git a/app/Repositories/Contracts/ProductRepositoryContract.php b/app/Repositories/Contracts/ProductRepositoryContract.php deleted file mode 100644 index 3e13abd1b..000000000 --- a/app/Repositories/Contracts/ProductRepositoryContract.php +++ /dev/null @@ -1,11 +0,0 @@ - 'filterIds', - 'slug' => 'must', - 'name' => 'filterName', - 'public' => 'filter', - 'available' => 'filter', - 'sets' => 'filterSlug', - 'sets_not' => 'filterNotSlug', - 'tags' => 'filterId', - 'tags_not' => 'filterNotId', - 'metadata' => 'filterMeta', - 'metadata_private' => 'filterMeta', - 'price_min' => 'filterPriceMin', - 'price_max' => 'filterPriceMax', - 'attribute' => 'filterAttributes', - 'attribute_not' => 'filterNotAttributes', - 'has_cover' => 'filterHas', - 'has_items' => 'filterHas', - 'has_schemas' => 'filterHas', - 'shipping_digital' => 'filter', - ]; - - public function __construct( - private SortServiceContract $sortService, - ) {} - - public function search(ProductSearchDto $dto): LengthAwarePaginator - { - $query = $dto->getSearch() === null ? Product::search() : Product::search($dto->getSearch()); - - if ($dto->getSort() !== null) { - $query = $this->sortService->sortScout($query, $dto->getSort()); - } - - foreach ($dto->toArray() as $key => $value) { - if (array_key_exists($key, self::CRITERIA)) { - $query = $this->{self::CRITERIA[$key]}($query, $key, $value); - } - } - - if (Gate::denies('products.show_hidden')) { - $query->filter(new Term('public', true)); - } - - try { - $results = $query->paginateRaw(Config::get('pagination.per_page')); - } catch (BadRequest400Exception $exception) { - $this->handleElastic400($exception); - } - - $products = new Collection(); - - // @phpstan-ignore-next-line - foreach ($results->items() as $item) { - if (!isset($item['hits']) || !isset($item['hits']['hits'])) { - continue; - } - foreach ($item['hits']['hits'] as $hit) { - $products->push($this->mapProduct($hit)); - } - } - - // @phpstan-ignore-next-line - $results->setCollection($products); - - // @phpstan-ignore-next-line - return $results; - } - - private function mapProduct(array $hit): Product - { - $product = new Product(); - $product->forceFill(Arr::only($hit['_source'], [ - 'id', - 'name', - 'slug', - 'price', - 'price_min', - 'price_max', - 'price_min_initial', - 'price_max_initial', - 'public', - 'available', - 'google_product_category', - 'shipping_digital', - 'shipping_date', - 'shipping_time', - 'quantity', - 'purchase_limit_per_user', - ])); - $product->forceFill(['description_html' => $hit['_source']['description']]); - - if ($hit['_source']['cover'] !== null) { - $media = new Media(); - $media->forceFill(Arr::except($hit['_source']['cover'], ['metadata', 'metadata_private'])); - $media->setRelation( - 'metadata', - $this->mapMetadata($hit['_source']['cover']['metadata'], true), - ); - $media->setRelation( - 'metadataPrivate', - $this->mapMetadata($hit['_source']['cover']['metadata_private'], false), - ); - $product->setRelation('media', Collection::make([$media])); - } else { - $product->setRelation('media', new Collection()); - } - - $tags = new Collection(); - foreach ($hit['_source']['tags'] as $raw) { - $tag = new Tag(); - $tag->forceFill($raw); - $tags->push($tag); - } - $product->setRelation('tags', $tags); - - $attributes = new Collection(); - foreach ($hit['_source']['attributes'] as $raw) { - $attribute = new Attribute(); - $properties = Arr::except($raw, ['values', 'metadata', 'metadata_private', 'attribute_type']); - $properties['type'] = $raw['attribute_type']; - $attribute->forceFill($properties); - - $options = new Collection(); - foreach ($raw['values'] as $value) { - $option = new AttributeOption(); - $option->forceFill(Arr::except($value, ['metadata', 'metadata_private'])); - $option->setRelation( - 'metadata', - $this->mapMetadata($value['metadata'], true), - ); - $option->setRelation( - 'metadataPrivate', - $this->mapMetadata($value['metadata_private'], false), - ); - $options->push($option); - } - $attribute->setRelation('options', $options); - $attribute->setRelation( - 'metadata', - $this->mapMetadata($raw['metadata'], true), - ); - $attribute->setRelation( - 'metadataPrivate', - $this->mapMetadata($raw['metadata_private'], false), - ); - - $attributes->push($attribute); - } - $product->setRelation('attributes', $attributes); - - $product->setRelation( - 'metadata', - $this->mapMetadata($hit['_source']['metadata'], true), - ); - $product->setRelation( - 'metadataPrivate', - $this->mapMetadata($hit['_source']['metadata_private'], false), - ); - - return $product; - } - - private function mapMetadata(array $metaList, bool $public): Collection - { - $collection = new Collection(); - - foreach ($metaList as $meta) { - $metadata = new Metadata(); - $metadata->forceFill([ - 'id' => $meta['id'], - 'name' => $meta['name'], - 'value' => $meta['value'], - 'value_type' => $meta['value_type'], - 'public' => $public, - ]); - $collection->push($metadata); - } - - return $collection; - } - - private function must(Builder $query, string $key, bool|float|int|string $value): Builder - { - return $query->must(new Matching($key, $value)); - } - - private function filterName(Builder $query, string $key, bool|float|int|string $value): Builder - { - $matching = new Matching($key, $value); - $matching->setBoost(10); - - return $query->must($matching); - } - - private function filter(Builder $query, string $key, bool|float|int|string $value): Builder - { - return $query->filter(new Term($key, $value)); - } - - private function filterSlug(Builder $query, string $key, array $slugs): Builder - { - return $query->filter(new Terms("{$key}_slug", $slugs)); - } - - private function filterNotSlug(Builder $query, string $key, array $slugs): Builder - { - return $query->filter( - Invert::query( - new Terms(Str::replace('_not', '_slug', $key), $slugs) - ) - ); - } - - private function filterId(Builder $query, string $key, array $ids): Builder - { - return $query->filter(new Terms("{$key}_id", $ids)); - } - - private function filterNotId(Builder $query, string $key, array $ids): Builder - { - return $query->filter( - Invert::query( - new Terms(Str::replace('_not', '_id', $key), $ids) - ) - ); - } - - private function filterIds(Builder $query, string $key, array $ids): Builder - { - $query->filter(new Terms('id', $ids)); - - return $query; - } - - private function filterMeta(Builder $query, string $key, array $meta): Builder - { - $values = array_map( - fn ($value) => (string) $value, - array_values($meta) - ); - - $query->filter(new Terms("{$key}.name", array_keys($meta))); - $query->filter(new Terms("{$key}.value", $values)); - - return $query; - } - - private function filterPriceMin(Builder $query, string $key, float $value): Builder - { - return $query->filter(new Range('price_min', ['gte' => $value])); - } - - private function filterPriceMax(Builder $query, string $key, float $value): Builder - { - return $query->filter(new Range('price_max', ['lte' => $value])); - } - - private function filterAttributes(Builder $query, string $key, array $attributes): Builder - { - $values = array_values($attributes)[0]; - - $query->filter(new Terms('attributes_slug', array_keys($attributes))); - - if (is_array($values) && !array_key_exists(0, $values)) { - $range = new Collection(); - - if (array_key_exists('min', $values)) { - $range->put('gte', $values['min']); - } - - if (array_key_exists('max', $values)) { - $range->put('lte', $values['max']); - } - - /** @phpstan-ignore-next-line */ - $field = is_numeric($range->first()) ? 'attributes.values.value_number' : 'attributes.values.value_date'; - $query->filter(new Nested('attributes.values', new Range($field, $range->toArray()))); - - return $query; - } - - if (is_string($values)) { - $values = Str::replace('%2C', ',', $values); - $values = explode(',', $values); - } - - $query->filter(new Nested('attributes.values', new Terms('attributes.values.id', (array) $values))); - - return $query; - } - - private function filterNotAttributes(Builder $query, string $key, array $attributes): Builder - { - $values = array_values($attributes)[0]; - - $query->filter(new Terms('attributes_slug', array_keys($attributes))); - - if (is_array($values) && !array_key_exists(0, $values)) { - $range = new Collection(); - - if (array_key_exists('min', $values)) { - $range->put('gte', $values['min']); - } - - if (array_key_exists('max', $values)) { - $range->put('lte', $values['max']); - } - - /** @phpstan-ignore-next-line */ - $field = is_numeric($range->first()) ? 'attributes.values.value_number' : 'attributes.values.value_date'; - $query->filter( - Invert::query( - new Nested('attributes.values', new Range($field, $range->toArray())) - ) - ); - - return $query; - } - - if (is_string($values)) { - $values = Str::replace('%2C', ',', $values); - $values = explode(',', $values); - } - - $query->filter( - Invert::query( - new Nested('attributes.values', new Terms('attributes.values.id', (array) $values)) - ) - ); - - return $query; - } - - private function filterHas(Builder $query, string $key, bool $value): Builder - { - $term = Exists::field(Str::after($key, 'has_')); - - return $query->filter($value ? $term : Invert::query($term)); - } - - private function handleElastic400(BadRequest400Exception $exception): void - { - $error = Str::of($exception->getMessage()); - - if ($error->contains('] in order to sort on')) { - throw new ClientException('Cannot sort by ' . $error->after('No mapping found for [')->before('] in order to sort on')); - } - - throw new ServerException(Exceptions::SERVER_MAPPING_NOT_FOUND); - } -} diff --git a/app/Repositories/Eloquent/ProductRepository.php b/app/Repositories/ProductRepository.php similarity index 81% rename from app/Repositories/Eloquent/ProductRepository.php rename to app/Repositories/ProductRepository.php index 6b0d022bc..17bc03fba 100644 --- a/app/Repositories/Eloquent/ProductRepository.php +++ b/app/Repositories/ProductRepository.php @@ -2,16 +2,15 @@ declare(strict_types=1); -namespace App\Repositories\Eloquent; +namespace App\Repositories; use App\Dtos\ProductSearchDto; use App\Models\Product; -use App\Repositories\Contracts\ProductRepositoryContract; use Illuminate\Contracts\Pagination\LengthAwarePaginator; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Gate; -class ProductRepository implements ProductRepositoryContract +class ProductRepository { public function search(ProductSearchDto $dto): LengthAwarePaginator { diff --git a/app/Services/AppService.php b/app/Services/AppService.php index 4a92f70b1..806b7650f 100644 --- a/app/Services/AppService.php +++ b/app/Services/AppService.php @@ -274,7 +274,7 @@ private function createAppOwnerRole(App $app, Collection $internalPermissions): private function makePermissionsPublic( App $app, Collection $internalPermissions, - Collection $publicPermissions + Collection $publicPermissions, ): void { $publicPermissions = $publicPermissions->map( fn ($permission) => "app.{$app->slug}.{$permission}", diff --git a/app/Services/AttributeOptionService.php b/app/Services/AttributeOptionService.php index 0b873bf59..b3a572fe2 100644 --- a/app/Services/AttributeOptionService.php +++ b/app/Services/AttributeOptionService.php @@ -3,6 +3,7 @@ namespace App\Services; use App\Dtos\AttributeOptionDto; +use App\Events\ProductSearchValueEvent; use App\Models\AttributeOption; use App\Services\Contracts\AttributeOptionServiceContract; use App\Services\Contracts\MetadataServiceContract; @@ -33,9 +34,12 @@ public function create(string $attributeId, AttributeOptionDto $dto): AttributeO public function updateOrCreate(string $attributeId, AttributeOptionDto $dto): AttributeOption { if ($dto->id !== null && !$dto->id instanceof Missing) { + /** @var AttributeOption $attributeOption */ $attributeOption = AttributeOption::findOrFail($dto->id); $attributeOption->update($dto->toArray()); + ProductSearchValueEvent::dispatch($attributeOption->productAttributes->pluck('product_id')->toArray()); + return $attributeOption; } @@ -44,7 +48,9 @@ public function updateOrCreate(string $attributeId, AttributeOptionDto $dto): At public function delete(AttributeOption $attributeOption): void { + $productIds = $attributeOption->productAttributes->pluck('product_id')->toArray(); $attributeOption->delete(); + ProductSearchValueEvent::dispatch($productIds); } public function deleteAll(string $attributeId): void diff --git a/app/Services/AttributeService.php b/app/Services/AttributeService.php index f5e249ca9..824a103c7 100644 --- a/app/Services/AttributeService.php +++ b/app/Services/AttributeService.php @@ -4,6 +4,7 @@ use App\Dtos\AttributeDto; use App\Enums\AttributeType; +use App\Events\ProductSearchValueEvent; use App\Models\Attribute; use App\Models\Product; use App\Services\Contracts\AttributeOptionServiceContract; @@ -34,15 +35,18 @@ public function create(AttributeDto $dto): Attribute public function update(Attribute $attribute, AttributeDto $dto): Attribute { $attribute->update($dto->toArray()); + ProductSearchValueEvent::dispatch($attribute->products->pluck('id')->toArray()); return $attribute; } public function delete(Attribute $attribute): void { + $products = $attribute->products->pluck('id')->toArray(); $this->attributeOptionService->deleteAll($attribute->getKey()); $attribute->delete(); + ProductSearchValueEvent::dispatch($products); } public function sync(Product $product, array $data): void @@ -51,7 +55,7 @@ public function sync(Product $product, array $data): void $product->attributes()->sync($attributes); $product->attributes()->get()->each( - fn (Attribute $attribute) => $attribute->pivot->options()->sync($data[$attribute->getKey()]) + fn (Attribute $attribute) => $attribute->pivot->options()->sync($data[$attribute->getKey()]), ); } diff --git a/app/Services/AuthService.php b/app/Services/AuthService.php index 3b5f61341..930d09e39 100644 --- a/app/Services/AuthService.php +++ b/app/Services/AuthService.php @@ -403,7 +403,7 @@ private function noTFACode(): void Auth::user()->securityCodes()->where('expires_at', '!=', null)->delete(); $code = $this->oneTimeSecurityCodeService->generateOneTimeSecurityCode( Auth::user(), - Config::get('tfa.code_expires_time') + Config::get('tfa.code_expires_time'), ); TfaSecurityCodeEvent::dispatch(Auth::user(), $code); @@ -534,7 +534,7 @@ private function googleTFA(): array $qr_code_url = $google_authenticator->getQRCodeGoogleUrl( $user->email, $secret, - Config::get('app.name') + Config::get('app.name'), ); $user->update([ @@ -556,7 +556,7 @@ private function emailTFA(): array $user->securityCodes()->delete(); $code = $this->oneTimeSecurityCodeService->generateOneTimeSecurityCode( $user, - Config::get('tfa.code_expires_time') + Config::get('tfa.code_expires_time'), ); $user->update([ diff --git a/app/Services/ConsentService.php b/app/Services/ConsentService.php index ca4881897..6cc043b8e 100644 --- a/app/Services/ConsentService.php +++ b/app/Services/ConsentService.php @@ -46,7 +46,7 @@ public function updateUserConsents(?Collection $consents, User $user): void ], [ 'value' => $value, - ] + ], ); }); } diff --git a/app/Services/Contracts/DiscountServiceContract.php b/app/Services/Contracts/DiscountServiceContract.php index 5f35817fa..54c3c8ed7 100644 --- a/app/Services/Contracts/DiscountServiceContract.php +++ b/app/Services/Contracts/DiscountServiceContract.php @@ -38,7 +38,7 @@ public function destroy(Discount $discount): void; public function checkCondition( DiscountCondition $condition, ?CartOrderDto $dto = null, - float $cartValue = 0 + float $cartValue = 0, ): bool; public function checkConditionGroup(ConditionGroup $group, CartOrderDto $dto, float $cartValue): bool; @@ -48,12 +48,12 @@ public function checkConditionGroups(Discount $discount, CartOrderDto $dto, floa public function applyDiscountOnProduct( Product $product, OrderProductDto $orderProductDto, - Discount $discount + Discount $discount, ): OrderProduct; public function applyDiscountsOnProducts(Collection $products): void; - public function applyDiscountsOnProduct(Product $product, bool $reindex = true): void; + public function applyDiscountsOnProduct(Product $product): void; public function applyDiscountOnOrderProduct(OrderProduct $orderProduct, Discount $discount): OrderProduct; diff --git a/app/Services/Contracts/ItemServiceContract.php b/app/Services/Contracts/ItemServiceContract.php index 8df00b278..84c2db9d5 100644 --- a/app/Services/Contracts/ItemServiceContract.php +++ b/app/Services/Contracts/ItemServiceContract.php @@ -23,6 +23,4 @@ public function store(ItemDto $dto): Item; public function update(Item $item, ItemDto $dto): Item; public function destroy(Item $item): void; - - public function refreshSearchable(Item $item): void; } diff --git a/app/Services/Contracts/ProductServiceContract.php b/app/Services/Contracts/ProductServiceContract.php index 107394eaa..0b3df2de4 100644 --- a/app/Services/Contracts/ProductServiceContract.php +++ b/app/Services/Contracts/ProductServiceContract.php @@ -24,4 +24,6 @@ public function getMinMaxPrices(Product $product): array; * Updates minimum and maximum possible product price. */ public function updateMinMaxPrices(Product $product): void; + + public function updateProductsSearchValues(array $productIds): void; } diff --git a/app/Services/Contracts/ProductSetServiceContract.php b/app/Services/Contracts/ProductSetServiceContract.php index 63ad3148d..0f4c0c503 100644 --- a/app/Services/Contracts/ProductSetServiceContract.php +++ b/app/Services/Contracts/ProductSetServiceContract.php @@ -25,7 +25,7 @@ public function updateChildren( Collection $children, string $parentId, string $parentSlug, - bool $publicParent + bool $publicParent, ): void; public function delete(ProductSet $set): void; @@ -39,6 +39,4 @@ public function flattenParentsSetsTree(Collection $sets): Collection; public function attach(ProductSet $set, array $productsIds): Collection; public function reorderProducts(ProductSet $set, ProductsReorderDto $dto): void; - - public function indexAllProducts(ProductSet $set): void; } diff --git a/app/Services/Contracts/SavedAddressServiceContract.php b/app/Services/Contracts/SavedAddressServiceContract.php index 25338c026..cbabd8ef1 100644 --- a/app/Services/Contracts/SavedAddressServiceContract.php +++ b/app/Services/Contracts/SavedAddressServiceContract.php @@ -9,13 +9,13 @@ interface SavedAddressServiceContract { public function storeAddress( SavedAddressDto $addressDto, - int $type + int $type, ): ?SavedAddress; public function updateAddress( SavedAddress $address, SavedAddressDto $addressDto, - int $type + int $type, ): SavedAddress; public function deleteSavedAddress(SavedAddress $address): void; diff --git a/app/Services/Contracts/SortServiceContract.php b/app/Services/Contracts/SortServiceContract.php index 615ed6226..547c2dcc5 100644 --- a/app/Services/Contracts/SortServiceContract.php +++ b/app/Services/Contracts/SortServiceContract.php @@ -3,11 +3,8 @@ namespace App\Services\Contracts; use Illuminate\Database\Eloquent\Builder; -use Laravel\Scout\Builder as ScoutBuilder; interface SortServiceContract { - public function sortScout(ScoutBuilder $query, ?string $sortString): Builder|ScoutBuilder; - - public function sort(Builder|ScoutBuilder $query, string $sortString, array $sortable): Builder|ScoutBuilder; + public function sort(Builder $query, string $sortString, array $sortable): Builder; } diff --git a/app/Services/DiscountService.php b/app/Services/DiscountService.php index bdd19da18..f27687e67 100644 --- a/app/Services/DiscountService.php +++ b/app/Services/DiscountService.php @@ -214,7 +214,7 @@ public function checkCondition( ConditionType::USER_IN => $this->checkConditionUserIn($condition), ConditionType::PRODUCT_IN_SET => $this->checkConditionProductInSet( $condition, - $dto?->getProductIds() ?? [] + $dto?->getProductIds() ?? [], ), ConditionType::PRODUCT_IN => $this->checkConditionProductIn($condition, $dto?->getProductIds() ?? []), ConditionType::DATE_BETWEEN => $this->checkConditionDateBetween($condition), @@ -361,11 +361,11 @@ public function calcCartDiscounts(CartDto $cart, Collection $products): CartReso if ($discount->code !== null) { $cartResource->coupons->push( - new CouponShortResource($discount->getKey(), $discount->name, $appliedDiscount, $discount->code) + new CouponShortResource($discount->getKey(), $discount->name, $appliedDiscount, $discount->code), ); } else { $cartResource->sales->push( - new SalesShortResource($discount->getKey(), $discount->name, $appliedDiscount) + new SalesShortResource($discount->getKey(), $discount->name, $appliedDiscount), ); } @@ -406,7 +406,7 @@ public function calcProductsListDiscounts(Collection $products): array public function applyDiscountOnProduct( Product $product, OrderProductDto $orderProductDto, - Discount $discount + Discount $discount, ): OrderProduct { $price = $product->price; @@ -432,10 +432,10 @@ public function applyDiscountsOnProducts(Collection $products): void } } - public function applyDiscountsOnProduct(Product $product, bool $reindex = true): void + public function applyDiscountsOnProduct(Product $product): void { $salesWithBlockList = $this->getSalesWithBlockList(); - $this->applyAllDiscountsOnProduct($product, $salesWithBlockList, $reindex); + $this->applyAllDiscountsOnProduct($product, $salesWithBlockList); } public function applyDiscountOnOrderProduct(OrderProduct $orderProduct, Discount $discount): OrderProduct @@ -518,7 +518,7 @@ public function activeSales(): Collection ->orWhere('type', ConditionType::WEEKDAY_IN); }); }) - ->orWhereDoesntHave('conditionGroups') + ->orWhereDoesntHave('conditionGroups'), ) ->with(['conditionGroups', 'conditionGroups.conditions']) ->get(); @@ -552,7 +552,7 @@ public function checkDiscountHasTimeConditions(Discount $discount): bool ConditionType::DATE_BETWEEN, ConditionType::TIME_BETWEEN, ConditionType::WEEKDAY_IN, - ] + ], )) { return true; } @@ -671,7 +671,6 @@ private function calcAllDiscountsOnProduct( public function applyAllDiscountsOnProduct( Product $product, Collection $salesWithBlockList, - bool $reindex = true, ): void { [ $minPriceDiscounted, @@ -687,10 +686,6 @@ public function applyAllDiscountsOnProduct( // detach and attach only add 2 queries to database, sync add 1 query for every element in given array, $product->sales()->detach(); $product->sales()->attach($productSales->pluck('id')); - - if ($reindex) { - $product->searchable(); - } } private function checkDiscountTarget(Discount $discount, CartDto $cart): bool @@ -723,7 +718,7 @@ private function checkDiscountTarget(Discount $discount, CartDto $cart): bool return in_array( $discount->target_type->value, - [DiscountTargetType::ORDER_VALUE, DiscountTargetType::CHEAPEST_PRODUCT] + [DiscountTargetType::ORDER_VALUE, DiscountTargetType::CHEAPEST_PRODUCT], ); } @@ -926,7 +921,7 @@ private function applyDiscountOnOrderShipping(Order $order, Discount $discount): if ( in_array( $order->shipping_method_id, - $discount->shippingMethods->pluck('id')->toArray() + $discount->shippingMethods->pluck('id')->toArray(), ) === $discount->target_is_allow_list ) { $appliedDiscount = $this->calcAppliedDiscount( @@ -1044,12 +1039,12 @@ private function applyDiscountOnCart(Discount $discount, CartDto $cartDto, CartR private function applyDiscountOnCartShipping( Discount $discount, CartDto $cartDto, - CartResource $cartResource + CartResource $cartResource, ): CartResource { if ( in_array( $cartDto->getShippingMethodId(), - $discount->shippingMethods->pluck('id')->toArray() + $discount->shippingMethods->pluck('id')->toArray(), ) === $discount->target_is_allow_list ) { $cartResource->shipping_price -= $this->calcAppliedDiscount( @@ -1220,7 +1215,7 @@ private function checkIsProductInDiscount(string $productId, Discount $discount) return $this->checkIsProductInDiscountProductSets( $productId, $discount->productSets, - $discount->target_is_allow_list + $discount->target_is_allow_list, ); } @@ -1235,7 +1230,7 @@ private function checkIsProductInDiscountProducts(string $productId, Discount $d private function checkIsProductInDiscountProductSets( string $productId, Collection $discountProductSets, - bool $allowList + bool $allowList, ): bool { /** @var Product $product */ $product = Product::query()->where('id', $productId)->firstOrFail(); @@ -1261,7 +1256,7 @@ private function checkIsProductInDiscountProductSets( private function checkProductSetParentInDiscount( ProductSet $productSet, Collection $productSets, - bool $allowList + bool $allowList, ): bool { if ($productSet->parent) { if ($productSets->contains($productSet->parent->id)) { @@ -1374,7 +1369,7 @@ private function checkConditionProductInSet(DiscountCondition $condition, array $result = $this->checkIsProductInDiscountProductSets( $productId, $productSets, - $conditionDto->isIsAllowList() + $conditionDto->isIsAllowList(), ); if ($result === $conditionDto->isIsAllowList()) { @@ -1552,11 +1547,8 @@ private function applyDiscountsOnProductsLazy(Collection $productIds, Collection $productQuery->chunk(100, function ($products) use ($salesWithBlockList): void { foreach ($products as $product) { - $this->applyAllDiscountsOnProduct($product, $salesWithBlockList, false); + $this->applyAllDiscountsOnProduct($product, $salesWithBlockList); } - - // @phpstan-ignore-next-line - Product::query()->whereIn('id', $products->pluck('id'))->searchable(); }); } } diff --git a/app/Services/ItemService.php b/app/Services/ItemService.php index 13891d6b9..de6d6d113 100644 --- a/app/Services/ItemService.php +++ b/app/Services/ItemService.php @@ -12,7 +12,6 @@ use App\Events\ItemUpdatedQuantity; use App\Exceptions\ClientException; use App\Models\Item; -use App\Models\Option; use App\Models\OrderProduct; use App\Models\Product; use App\Models\Schema; @@ -224,23 +223,6 @@ public function destroy(Item $item): void } } - /** - * Refresh serchable index on all related products. - */ - public function refreshSearchable(Item $item): void - { - $ids = $item->products()->select('id')->pluck('id'); - - /** @var Option $option */ - foreach ($item->options as $option) { - $productIds = $option->schema?->products()->select('id')->pluck('id'); - $ids->concat($productIds ? $productIds->toArray() : []); - } - - // @phpstan-ignore-next-line - Product::whereIn('id', $ids->unique())->searchable(); - } - private function checkItems(array $items): array { $selectedItems = []; @@ -249,7 +231,8 @@ private function checkItems(array $items): array /** @var OrderProductDto $item */ foreach ($items as $item) { - $product = Product::findOrFail($item->getProductId()); + /** @var Product $product */ + $product = Product::query()->findOrFail($item->getProductId()); $schemas = $item->getSchemas(); if ($product->purchase_limit_per_user !== null) { @@ -280,11 +263,14 @@ private function checkItems(array $items): array return [$products, $selectedItems]; } + /** + * @throws ClientException + */ private function checkProductPurchaseLimit( string $productId, float $limit, array $purchasedProducts, - float $quantity + float $quantity, ): array { $relation = Auth::user() instanceof User ? 'user' : 'app'; if (array_key_exists($productId, $purchasedProducts)) { diff --git a/app/Services/MetadataService.php b/app/Services/MetadataService.php index 4253dffd5..88e673c79 100644 --- a/app/Services/MetadataService.php +++ b/app/Services/MetadataService.php @@ -6,7 +6,6 @@ use App\Dtos\MetadataPersonalDto; use App\Dtos\MetadataPersonalListDto; use App\Models\Model; -use App\Models\Product; use App\Models\Role; use App\Models\User; use App\Services\Contracts\MetadataServiceContract; @@ -30,10 +29,6 @@ public function sync(Model|Role $model, array $metadata): void public function updateOrCreate(Model|Role $model, MetadataDto $dto): void { $this->processMetadata($model, $dto, $dto->isPublic() ? 'metadata' : 'metadataPrivate'); - - if ($model instanceof Product) { - $model->searchable(); - } } public function returnModel(array $routeSegments): Model|Role|null diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index d5676ef0f..88651858e 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -60,7 +60,7 @@ public function __construct( private ItemServiceContract $itemService, private NameServiceContract $nameService, private MetadataServiceContract $metadataService, - private DepositServiceContract $depositService + private DepositServiceContract $depositService, ) {} public function calcSummary(Order $order): float @@ -411,7 +411,7 @@ public function processOrderProductUrls(OrderProductUpdateDto $dto, OrderProduct public function indexMyOrderProducts(OrderProductSearchDto $dto): LengthAwarePaginator { return OrderProduct::searchByCriteria( - ['user' => Auth::id(), 'paid' => true] + $dto->toArray() + ['user' => Auth::id(), 'paid' => true] + $dto->toArray(), ) ->sort('created_at:desc') ->with(['urls', 'product']) @@ -538,7 +538,7 @@ private function removeItemsFromWarehouse(OrderProduct $orderProduct, array $tem private function resolveShippingAddress( Address|Missing|string|null $shippingPlace, string $shippingType, - Order $order + Order $order, ): ?string { if ($shippingPlace instanceof Missing) { return $order->shipping_address_id; @@ -569,7 +569,7 @@ private function resolveShippingAddress( private function resolveShippingPlace( Address|Missing|string|null $shippingPlace, string $shippingType, - Order $order + Order $order, ): ?string { if ($shippingPlace instanceof Missing) { return $order->shipping_place; diff --git a/app/Services/PackageTemplateService.php b/app/Services/PackageTemplateService.php index 14cc22148..41fcc4718 100644 --- a/app/Services/PackageTemplateService.php +++ b/app/Services/PackageTemplateService.php @@ -11,7 +11,7 @@ class PackageTemplateService implements PackageTemplateServiceContract { public function __construct( - private MetadataServiceContract $metadataService + private MetadataServiceContract $metadataService, ) {} public function store(PackageTemplateDto $dto): PackageTemplate diff --git a/app/Services/ProductService.php b/app/Services/ProductService.php index d517d6106..9ad49f9d3 100644 --- a/app/Services/ProductService.php +++ b/app/Services/ProductService.php @@ -9,6 +9,8 @@ use App\Events\ProductDeleted; use App\Events\ProductPriceUpdated; use App\Events\ProductUpdated; +use App\Models\Attribute; +use App\Models\AttributeOption; use App\Models\Option; use App\Models\Product; use App\Models\Schema; @@ -86,9 +88,9 @@ private function setup(Product $product, ProductCreateDto|ProductUpdateDto $dto) $product->available = $availability['available']; $product->shipping_time = $availability['shipping_time']; $product->shipping_date = $availability['shipping_date']; - $this->discountService->applyDiscountsOnProduct($product, false); + $this->discountService->applyDiscountsOnProduct($product); - return $product; + return $this->prepareProductSearchValues($product); } public function create(ProductCreateDto $dto): Product @@ -105,12 +107,10 @@ public function create(ProductCreateDto $dto): Product $product->getKey(), null, null, - $product->price_min, // @phpstan-ignore-line - $product->price_max, // @phpstan-ignore-line + $product->price_min ?? 0, + $product->price_max ?? 0, ); ProductCreated::dispatch($product); - // @phpstan-ignore-next-line - Product::where($product->getKeyName(), $product->getKey())->searchable(); return $product->refresh(); } @@ -133,14 +133,12 @@ public function update(Product $product, ProductUpdateDto $dto): Product $product->getKey(), $oldMinPrice, $oldMaxPrice, - $product->price_min, // @phpstan-ignore-line - $product->price_max, // @phpstan-ignore-line + $product->price_min ?? 0, + $product->price_max ?? 0, ); } ProductUpdated::dispatch($product); - // @phpstan-ignore-next-line - Product::query()->where($product->getKeyName(), $product->getKey())->searchable(); // fix for duplicated items in relation after recalculating availability $product->unsetRelation('items'); @@ -156,7 +154,6 @@ public function delete(Product $product): void $this->mediaService->sync($product, []); - $productId = $product->getKey(); $product->delete(); if ($product->seo !== null) { @@ -164,8 +161,6 @@ public function delete(Product $product): void } DB::commit(); - - Product::query()->where('id', $productId)->withTrashed()->first()?->unsearchable(); } public function getMinMaxPrices(Product $product): array @@ -191,6 +186,14 @@ public function updateMinMaxPrices(Product $product): void $this->discountService->applyDiscountsOnProduct($product); } + public function updateProductsSearchValues(array $productIds): void + { + Product::query() + ->whereIn('id', $productIds) + ->with(['tags', 'sets', 'attributes', 'attributes.options']) + ->each(fn (Product $product) => $this->prepareProductSearchValues($product)->save()); + } + private function assignItems(Product $product, ?array $items): void { $items = Collection::make($items)->mapWithKeys(fn (array $item): array => [ @@ -292,4 +295,27 @@ private function bestMinMax(Collection $minmaxCol): array }), ]; } + + private function prepareProductSearchValues(Product $product): Product + { + $searchValues = [ + ...$product->tags->pluck('name'), + ...$product->sets->pluck('name'), + ]; + + /** @var Attribute $attribute */ + foreach ($product->attributes as $attribute) { + $searchValues[] = $attribute->name; + /** @var AttributeOption $option */ + foreach ($attribute->pivot->options as $option) { + $searchValues[] = $option->name; + $searchValues[] = $option->value_number; + $searchValues[] = $option->value_date; + } + } + + $product->search_values = implode(' ', $searchValues); + + return $product; + } } diff --git a/app/Services/ProductSetService.php b/app/Services/ProductSetService.php index 7422666fe..eeed98c6e 100644 --- a/app/Services/ProductSetService.php +++ b/app/Services/ProductSetService.php @@ -5,6 +5,7 @@ use App\Dtos\ProductSetDto; use App\Dtos\ProductSetUpdateDto; use App\Dtos\ProductsReorderDto; +use App\Events\ProductSearchValueEvent; use App\Events\ProductSetCreated; use App\Events\ProductSetDeleted; use App\Events\ProductSetUpdated; @@ -24,7 +25,7 @@ use Illuminate\Validation\ValidationException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -class ProductSetService implements ProductSetServiceContract +final readonly class ProductSetService implements ProductSetServiceContract { public function __construct( private SeoMetadataServiceContract $seoMetadataService, @@ -116,6 +117,8 @@ public function create(ProductSetDto $dto): ProductSet $this->metadataService->sync($set, $dto->metadata); } + ProductSearchValueEvent::dispatch($set->allProductsIds()->toArray()); + // searchable is handled by the event listener ProductSetCreated::dispatch($set); @@ -126,7 +129,7 @@ public function updateChildren( Collection $children, string $parentId, ?string $parentSlug, - bool $publicParent + bool $publicParent, ): void { $children->each( function ($child, $order) use ($parentId, $parentSlug, $publicParent): void { @@ -140,7 +143,7 @@ function ($child, $order) use ($parentId, $parentSlug, $publicParent): void { $child->children, $child->getKey(), $childSlug, - $publicParent && $child->public + $publicParent && $child->public, ); $child->update([ @@ -188,6 +191,7 @@ public function update(ProductSet $set, ProductSetUpdateDto $dto): ProductSet $rootOrder = ProductSet::reversed()->first()?->order + 1; + $productIds = $set->allProductsIds()->merge($set->relatedProducts->pluck('id')); $set->children() ->whereNotIn('id', $dto->getChildrenIds()) ->update([ @@ -200,6 +204,7 @@ public function update(ProductSet $set, ProductSetUpdateDto $dto): ProductSet 'slug' => $slug, 'public_parent' => $publicParent, ]); + ProductSearchValueEvent::dispatch($productIds->toArray()); if (!($dto->getAttributesIds() instanceof Missing)) { $attributes = Collection::make($dto->getAttributesIds()); @@ -228,37 +233,34 @@ public function reorder(array $sets, ProductSet|null $parent = null): void public function attach(ProductSet $set, array $productsIds): Collection { - // old products for reindexing - $oldProductsIds = $set->products()->pluck('id'); + $currentProducts = $set->products()->pluck('id'); $set->products()->sync($productsIds); - // @phpstan-ignore-next-line - Product::query()->whereIn( - 'id', - $oldProductsIds->merge($productsIds)->unique(), - )->searchable(); + ProductSearchValueEvent::dispatch( + array_merge( + $currentProducts->diff($productsIds)->toArray(), + collect($productsIds)->diff($currentProducts)->toArray(), + ), + ); return $set->products; } public function delete(ProductSet $set): void { + $productIds = $set->allProductsIds()->merge($set->relatedProducts->pluck('id')); if ($set->children()->count() > 0) { $set->children->each(fn ($subset) => $this->delete($subset)); } - $productsIds = $set->allProductsIds(); - if ($set->delete()) { ProductSetDeleted::dispatch($set); if ($set->seo !== null) { $this->seoMetadataService->delete($set->seo); } + ProductSearchValueEvent::dispatch($productIds->toArray()); } - - // @phpstan-ignore-next-line - Product::query()->whereIn('id', $productsIds)->searchable(); } public function products(ProductSet $set): LengthAwarePaginator @@ -299,6 +301,7 @@ public function flattenParentsSetsTree(Collection $sets): Collection public function reorderProducts(ProductSet $set, ProductsReorderDto $dto): void { if (!$dto->getProducts() instanceof Missing) { + /** @var Product $product */ $product = $set->products()->where('id', $dto->getProducts()[0]['id'])->firstOrFail(); $order = $dto->getProducts()[0]['order']; $orderedProductsAmount = $set->products() @@ -330,12 +333,6 @@ public function reorderProducts(ProductSet $set, ProductsReorderDto $dto): void } } - public function indexAllProducts(ProductSet $set): void - { - // @phpstan-ignore-next-line - Product::query()->whereIn('id', $set->allProductsIds())->searchable(); - } - private function setHigherOrder(Product $product, int $order): void { DB::table('product_set_product')->where([ @@ -374,7 +371,7 @@ private function assignOrderToNulls(int $highestOrder, Collection $products): vo private function prepareSlug( bool|Missing $isOverridden, Missing|string|null $slugSuffix, - string $parentSlug + string $parentSlug, ): ?string { $slug = $slugSuffix instanceof Missing ? null : $slugSuffix; if (!$isOverridden instanceof Missing && !$isOverridden) { diff --git a/app/Services/SavedAddressService.php b/app/Services/SavedAddressService.php index 968dd4e12..a47377db6 100644 --- a/app/Services/SavedAddressService.php +++ b/app/Services/SavedAddressService.php @@ -48,7 +48,7 @@ public function storeAddress(SavedAddressDto $addressDto, int $type): ?SavedAddr public function updateAddress( SavedAddress $address, SavedAddressDto $addressDto, - int $type + int $type, ): SavedAddress { if (Auth::id() !== $address->user_id) { throw new AuthenticationException(); diff --git a/app/Services/SeoMetadataService.php b/app/Services/SeoMetadataService.php index 6d14e0600..ea515e5d2 100644 --- a/app/Services/SeoMetadataService.php +++ b/app/Services/SeoMetadataService.php @@ -29,7 +29,7 @@ public function createOrUpdate(SeoMetadataDto $dto): SeoMetadata /** @var SeoMetadata $seo */ $seo = SeoMetadata::query()->firstOrCreate( ['global' => true], - $dto->toArray() + $dto->toArray(), ); if (!$seo->wasRecentlyCreated) { diff --git a/app/Services/ShippingTimeDateService.php b/app/Services/ShippingTimeDateService.php index 91cef9e3d..b4f0c723e 100644 --- a/app/Services/ShippingTimeDateService.php +++ b/app/Services/ShippingTimeDateService.php @@ -17,7 +17,7 @@ class ShippingTimeDateService implements ShippingTimeDateServiceContract { public function __construct( private AvailabilityServiceContract $availabilityService, - private DepositServiceContract $depositService + private DepositServiceContract $depositService, ) {} public function stopShippingUnlimitedStockDate(): void diff --git a/app/Services/SortService.php b/app/Services/SortService.php index edf47e663..31e4cd56c 100644 --- a/app/Services/SortService.php +++ b/app/Services/SortService.php @@ -2,32 +2,20 @@ namespace App\Services; -use App\Enums\ExceptionsEnums\Exceptions; -use App\Exceptions\ClientException; -use App\Models\Contracts\SortableContract; use App\Rules\WhereIn; use App\Services\Contracts\SortServiceContract; -use Exception; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Str; -use Laravel\Scout\Builder as ScoutBuilder; +use Illuminate\Validation\ValidationException; class SortService implements SortServiceContract { /** - * @throws Exception + * @throws ValidationException */ - public function sortScout(ScoutBuilder $query, ?string $sortString): Builder|ScoutBuilder - { - if ($query->model instanceof SortableContract && $sortString !== null) { - return $this->sort($query, $sortString, $query->model->getSortable()); - } - throw new ClientException(Exceptions::CLIENT_MODEL_NOT_SORTABLE); - } - - public function sort(Builder|ScoutBuilder $query, string $sortString, array $sortable): Builder|ScoutBuilder + public function sort(Builder $query, string $sortString, array $sortable): Builder { $sort = explode(',', $sortString); @@ -44,6 +32,9 @@ public function sort(Builder|ScoutBuilder $query, string $sortString, array $sor return $query; } + /** + * @throws ValidationException + */ private function validate(array $field, array $sortable): void { Validator::make( @@ -59,19 +50,16 @@ private function validate(array $field, array $sortable): void )->validate(); } - // TODO: refactor this - private function addOrder(Builder|ScoutBuilder $query, string $field, string $order): void + private function addOrder(Builder $query, string $field, string $order): void { - if ($query instanceof Builder) { - if (Str::startsWith($field, 'set.')) { - $this->addSetOrder($query, $field, $order); + if (Str::startsWith($field, 'set.')) { + $this->addSetOrder($query, $field, $order); - return; - } elseif (Str::startsWith($field, 'attribute.')) { - $this->addAttributeOrder($query, $field, $order); + return; + } elseif (Str::startsWith($field, 'attribute.')) { + $this->addAttributeOrder($query, $field, $order); - return; - } + return; } $query->orderBy($field, $order); diff --git a/app/Services/StatusService.php b/app/Services/StatusService.php index 3d730bd13..ea79af55b 100644 --- a/app/Services/StatusService.php +++ b/app/Services/StatusService.php @@ -13,7 +13,7 @@ class StatusService implements StatusServiceContract { public function __construct( - private MetadataServiceContract $metadataService + private MetadataServiceContract $metadataService, ) {} public function store(StatusDto $dto): Status diff --git a/app/Traits/HasUuid.php b/app/Traits/HasUuid.php index 5470db31c..57e1b93c3 100644 --- a/app/Traits/HasUuid.php +++ b/app/Traits/HasUuid.php @@ -23,7 +23,7 @@ public static function boot(): void { static::creating(function ($model): void { if (!$model->getKey()) { - $model->{$model->getKeyName()} = Str::uuid()->toString(); + $model->{$model->getKeyName()} = Str::orderedUuid()->toString(); } }); diff --git a/app/Traits/Sortable.php b/app/Traits/Sortable.php index 301f85d75..5a4652c6e 100644 --- a/app/Traits/Sortable.php +++ b/app/Traits/Sortable.php @@ -4,21 +4,17 @@ use App\Services\Contracts\SortServiceContract; use Illuminate\Database\Eloquent\Builder; -use Laravel\Scout\Builder as ScoutBuilder; trait Sortable { - public function scopeSort(Builder $query, ?string $sortString = null): Builder|ScoutBuilder + public function scopeSort(Builder $query, ?string $sortString = null): Builder { - if ($sortString !== null) { - $query = app(SortServiceContract::class) - ->sort($query, $sortString, $this->getSortable()); + if ($sortString === null) { + return $query; } - return $query->orderBy( - $this->getDefaultSortBy(), - $this->getDefaultSortDirection(), - ); + return app(SortServiceContract::class) + ->sort($query, $sortString, $this->getSortable()); } public function getSortable(): array @@ -26,16 +22,4 @@ public function getSortable(): array // @phpstan-ignore-next-line return $this->sortable ?? []; } - - public function getDefaultSortBy(): string - { - // @phpstan-ignore-next-line - return $this->defaultSortBy ?? 'created_at'; - } - - public function getDefaultSortDirection(): string - { - // @phpstan-ignore-next-line - return $this->defaultSortDirection ?? 'asc'; - } } diff --git a/composer.json b/composer.json index 2d913957b..4346dfe8c 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ "ext-openssl": "*", "ext-soap": "*", "bensampo/laravel-enum": "^v6.2.1", - "bvlinsky/explorer": "^3.4.4", "guzzlehttp/guzzle": "^7.4", "guzzlehttp/psr7": "^2.2", "heseya/2fa": "^2.0", @@ -20,7 +19,6 @@ "heseya/pagination": "^1.0.3", "heseya/resource": "^1.0", "laravel/framework": "10.3.*", - "laravel/scout": "^9.4.5", "laravel/socialite": "^5.5", "league/omnipay": "^3.2", "omnipay/common": "^3.2", diff --git a/composer.lock b/composer.lock index 9a4828dd7..0b4def035 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "227d4d82b5312a6a4e0907c8c2457e4b", + "content-hash": "12efc0df6e839c364928dcd41344249a", "packages": [ { "name": "bensampo/laravel-enum", - "version": "v6.4.0", + "version": "v6.6.3", "source": { "type": "git", "url": "https://github.com/BenSampo/laravel-enum.git", - "reference": "22e9faff7f34a95ff6cd96bbc3fb4395d6ffbf4d" + "reference": "97cbf477e89024038d2b50f7b09aa7c2d44d6bd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/BenSampo/laravel-enum/zipball/22e9faff7f34a95ff6cd96bbc3fb4395d6ffbf4d", - "reference": "22e9faff7f34a95ff6cd96bbc3fb4395d6ffbf4d", + "url": "https://api.github.com/repos/BenSampo/laravel-enum/zipball/97cbf477e89024038d2b50f7b09aa7c2d44d6bd9", + "reference": "97cbf477e89024038d2b50f7b09aa7c2d44d6bd9", "shasum": "" }, "require": { @@ -33,12 +33,14 @@ "ergebnis/composer-normalize": "^2.28.3", "mll-lab/php-cs-fixer-config": "^5.4", "mockery/mockery": "^1.5", - "nunomaduro/larastan": "^2.1.12", + "nunomaduro/larastan": "^2.6.3", "orchestra/testbench": "^7.6.1 || ^8", "phpstan/phpstan": "^1.8.2", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-phpunit": "^1.1.1", - "phpunit/phpunit": "^9.5.21" + "phpunit/phpunit": "^9.5.21 || ^10", + "rector/rector": "^0.17.6", + "symplify/rule-doc-generator": "^11" }, "type": "library", "extra": { @@ -85,7 +87,7 @@ ], "support": { "issues": "https://github.com/BenSampo/laravel-enum/issues", - "source": "https://github.com/BenSampo/laravel-enum/tree/v6.4.0" + "source": "https://github.com/BenSampo/laravel-enum/tree/v6.6.3" }, "funding": [ { @@ -93,7 +95,7 @@ "type": "github" } ], - "time": "2023-07-05T08:16:59+00:00" + "time": "2023-08-31T14:24:02+00:00" }, { "name": "brick/math", @@ -150,72 +152,6 @@ ], "time": "2023-01-15T23:15:59+00:00" }, - { - "name": "bvlinsky/explorer", - "version": "3.4.4", - "source": { - "type": "git", - "url": "https://github.com/bvlinsky/Explorer.git", - "reference": "c6320bf19dd1bc069b92120e03271cd7ecae60ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bvlinsky/Explorer/zipball/c6320bf19dd1bc069b92120e03271cd7ecae60ab", - "reference": "c6320bf19dd1bc069b92120e03271cd7ecae60ab", - "shasum": "" - }, - "require": { - "elasticsearch/elasticsearch": "^7.16", - "illuminate/support": "^9.0|^10.0", - "laravel/scout": "^9.0", - "php": "8.0.*||8.1.*||8.2.*", - "webmozart/assert": "^1.10" - }, - "require-dev": { - "infection/infection": "^0.26", - "mockery/mockery": "^1.5", - "phpunit/phpunit": "~9.0", - "symplify/easy-coding-standard": "^9.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "JeroenG\\Explorer\\ExplorerServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "JeroenG\\Explorer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "EUPL-1.2" - ], - "authors": [ - { - "name": "Jeroen", - "email": "jeroengjeroeng@gmail.com", - "homepage": "https://jeroeng.dev" - } - ], - "description": "Next-gen Elasticsearch driver for Laravel Scout.", - "homepage": "https://jeroen-g.github.io/Explorer/", - "keywords": [ - "elastic", - "elasticsearch", - "explorer", - "laravel", - "scout", - "search" - ], - "support": { - "source": "https://github.com/bvlinsky/Explorer/tree/3.4.4" - }, - "time": "2023-03-02T08:45:43+00:00" - }, { "name": "clue/stream-filter", "version": "v1.6.0", @@ -718,16 +654,16 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v3.3.2", + "version": "v3.3.3", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8" + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", "shasum": "" }, "require": { @@ -767,7 +703,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.3" }, "funding": [ { @@ -775,7 +711,7 @@ "type": "github" } ], - "time": "2022-09-10T18:51:20+00:00" + "time": "2023-08-10T19:36:49+00:00" }, { "name": "egulias/email-validator", @@ -844,191 +780,18 @@ ], "time": "2023-01-14T14:17:03+00:00" }, - { - "name": "elasticsearch/elasticsearch", - "version": "v7.17.2", - "source": { - "type": "git", - "url": "git@github.com:elastic/elasticsearch-php.git", - "reference": "2d302233f2bb0926812d82823bb820d405e130fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/2d302233f2bb0926812d82823bb820d405e130fc", - "reference": "2d302233f2bb0926812d82823bb820d405e130fc", - "shasum": "" - }, - "require": { - "ext-json": ">=1.3.7", - "ezimuel/ringphp": "^1.1.2", - "php": "^7.3 || ^8.0", - "psr/log": "^1|^2|^3" - }, - "require-dev": { - "ext-yaml": "*", - "ext-zip": "*", - "mockery/mockery": "^1.2", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.3", - "squizlabs/php_codesniffer": "^3.4", - "symfony/finder": "~4.0" - }, - "suggest": { - "ext-curl": "*", - "monolog/monolog": "Allows for client-level logging and tracing" - }, - "type": "library", - "autoload": { - "files": [ - "src/autoload.php" - ], - "psr-4": { - "Elasticsearch\\": "src/Elasticsearch/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0", - "LGPL-2.1-only" - ], - "authors": [ - { - "name": "Zachary Tong" - }, - { - "name": "Enrico Zimuel" - } - ], - "description": "PHP Client for Elasticsearch", - "keywords": [ - "client", - "elasticsearch", - "search" - ], - "time": "2023-04-21T15:31:12+00:00" - }, - { - "name": "ezimuel/guzzlestreams", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/ezimuel/guzzlestreams.git", - "reference": "b4b5a025dfee70d6cd34c780e07330eb93d5b997" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ezimuel/guzzlestreams/zipball/b4b5a025dfee70d6cd34c780e07330eb93d5b997", - "reference": "b4b5a025dfee70d6cd34c780e07330eb93d5b997", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Fork of guzzle/streams (abandoned) to be used with elasticsearch-php", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "Guzzle", - "stream" - ], - "support": { - "source": "https://github.com/ezimuel/guzzlestreams/tree/3.1.0" - }, - "time": "2022-10-24T12:58:50+00:00" - }, - { - "name": "ezimuel/ringphp", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/ezimuel/ringphp.git", - "reference": "7887fc8488013065f72f977dcb281994f5fde9f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ezimuel/ringphp/zipball/7887fc8488013065f72f977dcb281994f5fde9f4", - "reference": "7887fc8488013065f72f977dcb281994f5fde9f4", - "shasum": "" - }, - "require": { - "ezimuel/guzzlestreams": "^3.0.1", - "php": ">=5.4.0", - "react/promise": "~2.0" - }, - "replace": { - "guzzlehttp/ringphp": "self.version" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~9.0" - }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Fork of guzzle/RingPHP (abandoned) to be used with elasticsearch-php", - "support": { - "source": "https://github.com/ezimuel/ringphp/tree/1.2.2" - }, - "time": "2022-12-07T11:28:53+00:00" - }, { "name": "firebase/php-jwt", - "version": "v6.8.0", + "version": "v6.8.1", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "48b0210c51718d682e53210c24d25c5a10a2299b" + "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/48b0210c51718d682e53210c24d25c5a10a2299b", - "reference": "48b0210c51718d682e53210c24d25c5a10a2299b", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5dbc8959427416b8ee09a100d7a8588c00fb2e26", + "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26", "shasum": "" }, "require": { @@ -1076,9 +839,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.8.0" + "source": "https://github.com/firebase/php-jwt/tree/v6.8.1" }, - "time": "2023-06-20T16:45:35+00:00" + "time": "2023-07-14T18:33:00+00:00" }, { "name": "fruitcake/php-cors", @@ -1153,16 +916,16 @@ }, { "name": "giggsey/libphonenumber-for-php", - "version": "8.13.15", + "version": "8.13.19", "source": { "type": "git", "url": "https://github.com/giggsey/libphonenumber-for-php.git", - "reference": "b294846e26ea985e6b1fbdfaf15387daca60c2de" + "reference": "7b60d1264ba806e68fb99b06e73e2ed07815689e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/b294846e26ea985e6b1fbdfaf15387daca60c2de", - "reference": "b294846e26ea985e6b1fbdfaf15387daca60c2de", + "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/7b60d1264ba806e68fb99b06e73e2ed07815689e", + "reference": "7b60d1264ba806e68fb99b06e73e2ed07815689e", "shasum": "" }, "require": { @@ -1221,7 +984,7 @@ "issues": "https://github.com/giggsey/libphonenumber-for-php/issues", "source": "https://github.com/giggsey/libphonenumber-for-php" }, - "time": "2023-06-23T07:47:45+00:00" + "time": "2023-08-22T13:59:44+00:00" }, { "name": "giggsey/locale", @@ -1341,22 +1104,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.7.0", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0", - "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -1447,7 +1210,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.7.0" + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" }, "funding": [ { @@ -1463,20 +1226,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T14:04:53+00:00" + "time": "2023-08-27T10:20:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { @@ -1530,7 +1293,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.0" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -1546,20 +1309,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T13:50:22+00:00" + "time": "2023-08-03T15:11:55+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.5.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", "shasum": "" }, "require": { @@ -1646,7 +1409,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.5.0" + "source": "https://github.com/guzzle/psr7/tree/2.6.1" }, "funding": [ { @@ -1662,20 +1425,20 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:11:26+00:00" + "time": "2023-08-27T10:13:57+00:00" }, { "name": "guzzlehttp/uri-template", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/guzzle/uri-template.git", - "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2" + "reference": "61bf437fc2197f587f6857d3ff903a24f1731b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/uri-template/zipball/b945d74a55a25a949158444f09ec0d3c120d69e2", - "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/61bf437fc2197f587f6857d3ff903a24f1731b5d", + "reference": "61bf437fc2197f587f6857d3ff903a24f1731b5d", "shasum": "" }, "require": { @@ -1683,15 +1446,11 @@ "symfony/polyfill-php80": "^1.17" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", "phpunit/phpunit": "^8.5.19 || ^9.5.8", "uri-template/tests": "1.0.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "psr-4": { "GuzzleHttp\\UriTemplate\\": "src" @@ -1730,7 +1489,7 @@ ], "support": { "issues": "https://github.com/guzzle/uri-template/issues", - "source": "https://github.com/guzzle/uri-template/tree/v1.0.1" + "source": "https://github.com/guzzle/uri-template/tree/v1.0.2" }, "funding": [ { @@ -1746,7 +1505,7 @@ "type": "tidelift" } ], - "time": "2021-10-07T12:57:01+00:00" + "time": "2023-08-27T10:19:19+00:00" }, { "name": "heseya/2fa", @@ -2330,91 +2089,18 @@ }, "time": "2023-03-09T14:00:53+00:00" }, - { - "name": "laravel/scout", - "version": "v9.8.1", - "source": { - "type": "git", - "url": "https://github.com/laravel/scout.git", - "reference": "38595717b396ce733d432b82e3225fa4e0d6c8ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/scout/zipball/38595717b396ce733d432b82e3225fa4e0d6c8ef", - "reference": "38595717b396ce733d432b82e3225fa4e0d6c8ef", - "shasum": "" - }, - "require": { - "illuminate/bus": "^8.0|^9.0|^10.0", - "illuminate/contracts": "^8.0|^9.0|^10.0", - "illuminate/database": "^8.0|^9.0|^10.0", - "illuminate/http": "^8.0|^9.0|^10.0", - "illuminate/pagination": "^8.0|^9.0|^10.0", - "illuminate/queue": "^8.0|^9.0|^10.0", - "illuminate/support": "^8.0|^9.0|^10.0", - "php": "^7.3|^8.0" - }, - "require-dev": { - "meilisearch/meilisearch-php": "^0.19", - "mockery/mockery": "^1.0", - "orchestra/testbench": "^6.17|^7.0|^8.0", - "php-http/guzzle7-adapter": "^1.0", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "algolia/algoliasearch-client-php": "Required to use the Algolia engine (^3.2).", - "meilisearch/meilisearch-php": "Required to use the MeiliSearch engine (^0.23)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev" - }, - "laravel": { - "providers": [ - "Laravel\\Scout\\ScoutServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Laravel\\Scout\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Laravel Scout provides a driver based solution to searching your Eloquent models.", - "keywords": [ - "algolia", - "laravel", - "search" - ], - "support": { - "issues": "https://github.com/laravel/scout/issues", - "source": "https://github.com/laravel/scout" - }, - "time": "2023-02-14T16:53:14+00:00" - }, { "name": "laravel/serializable-closure", - "version": "v1.3.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37" + "reference": "e5a3057a5591e1cfe8183034b0203921abe2c902" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e5a3057a5591e1cfe8183034b0203921abe2c902", + "reference": "e5a3057a5591e1cfe8183034b0203921abe2c902", "shasum": "" }, "require": { @@ -2461,20 +2147,20 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2023-01-30T18:31:20+00:00" + "time": "2023-07-14T13:56:28+00:00" }, { "name": "laravel/socialite", - "version": "v5.6.3", + "version": "v5.8.1", "source": { "type": "git", "url": "https://github.com/laravel/socialite.git", - "reference": "00ea7f8630673ea49304fc8a9fca5a64eb838c7e" + "reference": "9989b4530331597fae811bca240bf4e8f15e804b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/00ea7f8630673ea49304fc8a9fca5a64eb838c7e", - "reference": "00ea7f8630673ea49304fc8a9fca5a64eb838c7e", + "url": "https://api.github.com/repos/laravel/socialite/zipball/9989b4530331597fae811bca240bf4e8f15e804b", + "reference": "9989b4530331597fae811bca240bf4e8f15e804b", "shasum": "" }, "require": { @@ -2531,7 +2217,7 @@ "issues": "https://github.com/laravel/socialite/issues", "source": "https://github.com/laravel/socialite" }, - "time": "2023-06-06T13:42:43+00:00" + "time": "2023-08-21T13:06:52+00:00" }, { "name": "lcobucci/clock", @@ -2673,16 +2359,16 @@ }, { "name": "league/commonmark", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048" + "reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d44a24690f16b8c1808bf13b1bd54ae4c63ea048", - "reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/3669d6d5f7a47a93c08ddff335e6d945481a1dd5", + "reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5", "shasum": "" }, "require": { @@ -2775,7 +2461,7 @@ "type": "tidelift" } ], - "time": "2023-03-24T15:16:10+00:00" + "time": "2023-08-30T16:55:00+00:00" }, { "name": "league/config", @@ -3009,26 +2695,26 @@ }, { "name": "league/mime-type-detection", - "version": "1.11.0", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" + "reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/a6dfb1194a2946fcdc1f38219445234f65b35c96", + "reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { @@ -3049,7 +2735,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.11.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.13.0" }, "funding": [ { @@ -3061,7 +2747,7 @@ "type": "tidelift" } ], - "time": "2022-04-17T13:12:02+00:00" + "time": "2023-08-05T12:09:49+00:00" }, { "name": "league/oauth1-client", @@ -3458,25 +3144,29 @@ }, { "name": "nesbot/carbon", - "version": "2.68.1", + "version": "2.69.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da" + "reference": "4308217830e4ca445583a37d1bf4aff4153fa81c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4f991ed2a403c85efbc4f23eb4030063fdbe01da", - "reference": "4f991ed2a403c85efbc4f23eb4030063fdbe01da", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4308217830e4ca445583a37d1bf4aff4153fa81c", + "reference": "4308217830e4ca445583a37d1bf4aff4153fa81c", "shasum": "" }, "require": { "ext-json": "*", "php": "^7.1.8 || ^8.0", + "psr/clock": "^1.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, + "provide": { + "psr/clock-implementation": "1.0" + }, "require-dev": { "doctrine/dbal": "^2.0 || ^3.1.4", "doctrine/orm": "^2.7", @@ -3556,25 +3246,25 @@ "type": "tidelift" } ], - "time": "2023-06-20T18:29:04+00:00" + "time": "2023-08-03T09:00:52+00:00" }, { "name": "nette/schema", - "version": "v1.2.3", + "version": "v1.2.4", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f" + "reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", + "url": "https://api.github.com/repos/nette/schema/zipball/c9ff517a53903b3d4e29ec547fb20feecb05b8ab", + "reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab", "shasum": "" }, "require": { "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.3" + "php": "7.1 - 8.3" }, "require-dev": { "nette/tester": "^2.3 || ^2.4", @@ -3616,26 +3306,26 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.3" + "source": "https://github.com/nette/schema/tree/v1.2.4" }, - "time": "2022-10-13T01:24:26+00:00" + "time": "2023-08-05T18:56:25+00:00" }, { "name": "nette/utils", - "version": "v4.0.0", + "version": "v4.0.1", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e" + "reference": "9124157137da01b1f5a5a22d6486cb975f26db7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/cacdbf5a91a657ede665c541eda28941d4b09c1e", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e", + "url": "https://api.github.com/repos/nette/utils/zipball/9124157137da01b1f5a5a22d6486cb975f26db7e", + "reference": "9124157137da01b1f5a5a22d6486cb975f26db7e", "shasum": "" }, "require": { - "php": ">=8.0 <8.3" + "php": ">=8.0 <8.4" }, "conflict": { "nette/finder": "<3", @@ -3643,7 +3333,7 @@ }, "require-dev": { "jetbrains/phpstorm-attributes": "dev-master", - "nette/tester": "^2.4", + "nette/tester": "^2.5", "phpstan/phpstan": "^1.0", "tracy/tracy": "^2.9" }, @@ -3703,22 +3393,22 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.0" + "source": "https://github.com/nette/utils/tree/v4.0.1" }, - "time": "2023-02-02T10:41:53+00:00" + "time": "2023-07-30T15:42:21+00:00" }, { "name": "nikic/php-parser", - "version": "v4.16.0", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -3759,9 +3449,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2023-06-25T14:52:30+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "nunomaduro/termwind", @@ -4243,16 +3933,16 @@ }, { "name": "php-http/discovery", - "version": "1.19.0", + "version": "1.19.1", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "1856a119a0b0ba8da8b5c33c080aa7af8fac25b4" + "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/1856a119a0b0ba8da8b5c33c080aa7af8fac25b4", - "reference": "1856a119a0b0ba8da8b5c33c080aa7af8fac25b4", + "url": "https://api.github.com/repos/php-http/discovery/zipball/57f3de01d32085fea20865f9b16fb0e69347c39e", + "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e", "shasum": "" }, "require": { @@ -4315,9 +4005,9 @@ ], "support": { "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.19.0" + "source": "https://github.com/php-http/discovery/tree/1.19.1" }, - "time": "2023-06-19T08:45:36+00:00" + "time": "2023-07-11T07:02:26+00:00" }, { "name": "php-http/guzzle7-adapter", @@ -4768,16 +4458,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", "shasum": "" }, "require": { @@ -4820,9 +4510,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3" }, - "time": "2023-05-30T18:13:47+00:00" + "time": "2023-08-12T11:01:26+00:00" }, { "name": "phpoption/phpoption", @@ -4901,16 +4591,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.22.1", + "version": "1.23.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0" + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/65c39594fbd8c67abfc68bb323f86447bab79cc0", - "reference": "65c39594fbd8c67abfc68bb323f86447bab79cc0", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26", + "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26", "shasum": "" }, "require": { @@ -4942,9 +4632,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.22.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1" }, - "time": "2023-06-29T20:46:06+00:00" + "time": "2023-08-03T16:32:59+00:00" }, { "name": "predis/predis", @@ -5721,78 +5411,6 @@ ], "time": "2023-04-15T23:01:58+00:00" }, - { - "name": "react/promise", - "version": "v2.10.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", - "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], - "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.10.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2023-05-02T15:15:43+00:00" - }, { "name": "sentry/sdk", "version": "3.5.0", @@ -5852,16 +5470,16 @@ }, { "name": "sentry/sentry", - "version": "3.20.1", + "version": "3.21.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "644ad9768c18139a80ac510090fad000d9ffd8a4" + "reference": "624aafc22b84b089ffa43b71fb01e0096505ec4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/644ad9768c18139a80ac510090fad000d9ffd8a4", - "reference": "644ad9768c18139a80ac510090fad000d9ffd8a4", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/624aafc22b84b089ffa43b71fb01e0096505ec4f", + "reference": "624aafc22b84b089ffa43b71fb01e0096505ec4f", "shasum": "" }, "require": { @@ -5905,11 +5523,6 @@ "monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler." }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.13.x-dev" - } - }, "autoload": { "files": [ "src/functions.php" @@ -5941,7 +5554,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.20.1" + "source": "https://github.com/getsentry/sentry-php/tree/3.21.0" }, "funding": [ { @@ -5953,20 +5566,20 @@ "type": "custom" } ], - "time": "2023-06-26T11:01:40+00:00" + "time": "2023-07-31T15:31:24+00:00" }, { "name": "sentry/sentry-laravel", - "version": "3.6.1", + "version": "3.7.3", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "eb94a52b88794d0c108dc46ca1a680531c3a8bad" + "reference": "2aee4ad217be8ef04ffcde6e9f7dd17af5a3b0bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/eb94a52b88794d0c108dc46ca1a680531c3a8bad", - "reference": "eb94a52b88794d0c108dc46ca1a680531c3a8bad", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/2aee4ad217be8ef04ffcde6e9f7dd17af5a3b0bf", + "reference": "2aee4ad217be8ef04ffcde6e9f7dd17af5a3b0bf", "shasum": "" }, "require": { @@ -5974,7 +5587,7 @@ "nyholm/psr7": "^1.0", "php": "^7.2 | ^8.0", "sentry/sdk": "^3.4", - "sentry/sentry": "^3.20", + "sentry/sentry": "^3.20.1", "symfony/psr-http-message-bridge": "^1.0 | ^2.0" }, "require-dev": { @@ -5982,6 +5595,7 @@ "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", "mockery/mockery": "^1.3", "orchestra/testbench": "^4.7 | ^5.1 | ^6.0 | ^7.0 | ^8.0", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^8.4 | ^9.3" }, "type": "library", @@ -6031,7 +5645,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/3.6.1" + "source": "https://github.com/getsentry/sentry-laravel/tree/3.7.3" }, "funding": [ { @@ -6043,7 +5657,7 @@ "type": "custom" } ], - "time": "2023-07-04T10:30:42+00:00" + "time": "2023-08-03T10:10:23+00:00" }, { "name": "socialiteproviders/apple", @@ -6119,22 +5733,22 @@ }, { "name": "socialiteproviders/manager", - "version": "v4.3.0", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/SocialiteProviders/Manager.git", - "reference": "47402cbc5b7ef445317e799bf12fd5a12062206c" + "reference": "df5e45b53d918ec3d689f014d98a6c838b98ed96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SocialiteProviders/Manager/zipball/47402cbc5b7ef445317e799bf12fd5a12062206c", - "reference": "47402cbc5b7ef445317e799bf12fd5a12062206c", + "url": "https://api.github.com/repos/SocialiteProviders/Manager/zipball/df5e45b53d918ec3d689f014d98a6c838b98ed96", + "reference": "df5e45b53d918ec3d689f014d98a6c838b98ed96", "shasum": "" }, "require": { "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0", "laravel/socialite": "~5.0", - "php": "^7.4 || ^8.0" + "php": "^8.0" }, "require-dev": { "mockery/mockery": "^1.2", @@ -6189,7 +5803,7 @@ "issues": "https://github.com/socialiteproviders/manager/issues", "source": "https://github.com/socialiteproviders/manager" }, - "time": "2023-01-26T23:11:27+00:00" + "time": "2023-08-27T23:46:34+00:00" }, { "name": "socialiteproviders/zoho", @@ -6234,16 +5848,16 @@ }, { "name": "spatie/laravel-data", - "version": "3.7.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-data.git", - "reference": "a975123d86e0133a361ac225d17acb3d11aa351f" + "reference": "7ead3d8f761846185a94d06e584bfe17e43b9239" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-data/zipball/a975123d86e0133a361ac225d17acb3d11aa351f", - "reference": "a975123d86e0133a361ac225d17acb3d11aa351f", + "url": "https://api.github.com/repos/spatie/laravel-data/zipball/7ead3d8f761846185a94d06e584bfe17e43b9239", + "reference": "7ead3d8f761846185a94d06e584bfe17e43b9239", "shasum": "" }, "require": { @@ -6305,7 +5919,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-data/issues", - "source": "https://github.com/spatie/laravel-data/tree/3.7.0" + "source": "https://github.com/spatie/laravel-data/tree/3.8.1" }, "funding": [ { @@ -6313,20 +5927,20 @@ "type": "github" } ], - "time": "2023-07-05T11:45:14+00:00" + "time": "2023-08-11T11:59:07+00:00" }, { "name": "spatie/laravel-package-tools", - "version": "1.15.0", + "version": "1.16.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-package-tools.git", - "reference": "efab1844b8826443135201c4443690f032c3d533" + "reference": "cc7c991555a37f9fa6b814aa03af73f88026a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/efab1844b8826443135201c4443690f032c3d533", - "reference": "efab1844b8826443135201c4443690f032c3d533", + "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/cc7c991555a37f9fa6b814aa03af73f88026a83d", + "reference": "cc7c991555a37f9fa6b814aa03af73f88026a83d", "shasum": "" }, "require": { @@ -6365,7 +5979,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-package-tools/issues", - "source": "https://github.com/spatie/laravel-package-tools/tree/1.15.0" + "source": "https://github.com/spatie/laravel-package-tools/tree/1.16.1" }, "funding": [ { @@ -6373,20 +5987,20 @@ "type": "github" } ], - "time": "2023-04-27T08:09:01+00:00" + "time": "2023-08-23T09:04:39+00:00" }, { "name": "spatie/laravel-permission", - "version": "5.10.2", + "version": "5.11.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-permission.git", - "reference": "671e46e079cbd4990a98427daaa09f4977b57ca9" + "reference": "0a35e99da4cb6f85b07b3b58b718ff659c39a009" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/671e46e079cbd4990a98427daaa09f4977b57ca9", - "reference": "671e46e079cbd4990a98427daaa09f4977b57ca9", + "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/0a35e99da4cb6f85b07b3b58b718ff659c39a009", + "reference": "0a35e99da4cb6f85b07b3b58b718ff659c39a009", "shasum": "" }, "require": { @@ -6447,7 +6061,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-permission/issues", - "source": "https://github.com/spatie/laravel-permission/tree/5.10.2" + "source": "https://github.com/spatie/laravel-permission/tree/5.11.0" }, "funding": [ { @@ -6455,7 +6069,7 @@ "type": "github" } ], - "time": "2023-07-04T13:38:13+00:00" + "time": "2023-08-30T23:41:24+00:00" }, { "name": "spatie/laravel-webhook-server", @@ -6533,16 +6147,16 @@ }, { "name": "symfony/console", - "version": "v6.3.0", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7" + "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", - "reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7", + "url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", + "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", "shasum": "" }, "require": { @@ -6603,7 +6217,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.0" + "source": "https://github.com/symfony/console/tree/v6.3.4" }, "funding": [ { @@ -6619,20 +6233,20 @@ "type": "tidelift" } ], - "time": "2023-05-29T12:49:39+00:00" + "time": "2023-08-16T10:10:12+00:00" }, { "name": "symfony/css-selector", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf" + "reference": "883d961421ab1709877c10ac99451632a3d6fa57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf", - "reference": "88453e64cd86c5b60e8d2fb2c6f953bbc353ffbf", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/883d961421ab1709877c10ac99451632a3d6fa57", + "reference": "883d961421ab1709877c10ac99451632a3d6fa57", "shasum": "" }, "require": { @@ -6668,7 +6282,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.3.0" + "source": "https://github.com/symfony/css-selector/tree/v6.3.2" }, "funding": [ { @@ -6684,7 +6298,7 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:43:42+00:00" + "time": "2023-07-12T16:00:22+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6755,16 +6369,16 @@ }, { "name": "symfony/error-handler", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "99d2d814a6351461af350ead4d963bd67451236f" + "reference": "85fd65ed295c4078367c784e8a5a6cee30348b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/99d2d814a6351461af350ead4d963bd67451236f", - "reference": "99d2d814a6351461af350ead4d963bd67451236f", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/85fd65ed295c4078367c784e8a5a6cee30348b7a", + "reference": "85fd65ed295c4078367c784e8a5a6cee30348b7a", "shasum": "" }, "require": { @@ -6809,7 +6423,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.3.0" + "source": "https://github.com/symfony/error-handler/tree/v6.3.2" }, "funding": [ { @@ -6825,20 +6439,20 @@ "type": "tidelift" } ], - "time": "2023-05-10T12:03:13+00:00" + "time": "2023-07-16T17:05:46+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa" + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", - "reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e", + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e", "shasum": "" }, "require": { @@ -6889,7 +6503,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.2" }, "funding": [ { @@ -6905,7 +6519,7 @@ "type": "tidelift" } ], - "time": "2023-04-21T14:41:17+00:00" + "time": "2023-07-06T06:56:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -6985,16 +6599,16 @@ }, { "name": "symfony/finder", - "version": "v6.3.0", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2" + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d9b01ba073c44cef617c7907ce2419f8d00d75e2", - "reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2", + "url": "https://api.github.com/repos/symfony/finder/zipball/9915db259f67d21eefee768c1abcf1cc61b1fc9e", + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e", "shasum": "" }, "require": { @@ -7029,7 +6643,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.3.0" + "source": "https://github.com/symfony/finder/tree/v6.3.3" }, "funding": [ { @@ -7045,20 +6659,20 @@ "type": "tidelift" } ], - "time": "2023-04-02T01:25:41+00:00" + "time": "2023-07-31T08:31:44+00:00" }, { "name": "symfony/http-client", - "version": "v6.3.1", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "1c828a06aef2f5eeba42026dfc532d4fc5406123" + "reference": "15f9f4bad62bfcbe48b5dedd866f04a08fc7ff00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/1c828a06aef2f5eeba42026dfc532d4fc5406123", - "reference": "1c828a06aef2f5eeba42026dfc532d4fc5406123", + "url": "https://api.github.com/repos/symfony/http-client/zipball/15f9f4bad62bfcbe48b5dedd866f04a08fc7ff00", + "reference": "15f9f4bad62bfcbe48b5dedd866f04a08fc7ff00", "shasum": "" }, "require": { @@ -7121,7 +6735,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.3.1" + "source": "https://github.com/symfony/http-client/tree/v6.3.2" }, "funding": [ { @@ -7137,7 +6751,7 @@ "type": "tidelift" } ], - "time": "2023-06-24T11:51:27+00:00" + "time": "2023-07-05T08:41:27+00:00" }, { "name": "symfony/http-client-contracts", @@ -7219,16 +6833,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.3.1", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e0ad0d153e1c20069250986cd9e9dd1ccebb0d66" + "reference": "cac1556fdfdf6719668181974104e6fcfa60e844" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e0ad0d153e1c20069250986cd9e9dd1ccebb0d66", - "reference": "e0ad0d153e1c20069250986cd9e9dd1ccebb0d66", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cac1556fdfdf6719668181974104e6fcfa60e844", + "reference": "cac1556fdfdf6719668181974104e6fcfa60e844", "shasum": "" }, "require": { @@ -7276,7 +6890,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.3.1" + "source": "https://github.com/symfony/http-foundation/tree/v6.3.4" }, "funding": [ { @@ -7292,20 +6906,20 @@ "type": "tidelift" } ], - "time": "2023-06-24T11:51:27+00:00" + "time": "2023-08-22T08:20:46+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.3.1", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "161e16fd2e35fb4881a43bc8b383dfd5be4ac374" + "reference": "36abb425b4af863ae1fe54d8a8b8b4c76a2bccdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/161e16fd2e35fb4881a43bc8b383dfd5be4ac374", - "reference": "161e16fd2e35fb4881a43bc8b383dfd5be4ac374", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/36abb425b4af863ae1fe54d8a8b8b4c76a2bccdb", + "reference": "36abb425b4af863ae1fe54d8a8b8b4c76a2bccdb", "shasum": "" }, "require": { @@ -7314,7 +6928,7 @@ "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^6.3", "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-foundation": "^6.2.7", + "symfony/http-foundation": "^6.3.4", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -7322,7 +6936,7 @@ "symfony/cache": "<5.4", "symfony/config": "<6.1", "symfony/console": "<5.4", - "symfony/dependency-injection": "<6.3", + "symfony/dependency-injection": "<6.3.4", "symfony/doctrine-bridge": "<5.4", "symfony/form": "<5.4", "symfony/http-client": "<5.4", @@ -7346,7 +6960,7 @@ "symfony/config": "^6.1", "symfony/console": "^5.4|^6.0", "symfony/css-selector": "^5.4|^6.0", - "symfony/dependency-injection": "^6.3", + "symfony/dependency-injection": "^6.3.4", "symfony/dom-crawler": "^5.4|^6.0", "symfony/expression-language": "^5.4|^6.0", "symfony/finder": "^5.4|^6.0", @@ -7389,7 +7003,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.3.1" + "source": "https://github.com/symfony/http-kernel/tree/v6.3.4" }, "funding": [ { @@ -7405,7 +7019,7 @@ "type": "tidelift" } ], - "time": "2023-06-26T06:07:32+00:00" + "time": "2023-08-26T13:54:49+00:00" }, { "name": "symfony/mailer", @@ -7489,20 +7103,21 @@ }, { "name": "symfony/mime", - "version": "v6.3.0", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "7b5d2121858cd6efbed778abce9cfdd7ab1f62ad" + "reference": "9a0cbd52baa5ba5a5b1f0cacc59466f194730f98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/7b5d2121858cd6efbed778abce9cfdd7ab1f62ad", - "reference": "7b5d2121858cd6efbed778abce9cfdd7ab1f62ad", + "url": "https://api.github.com/repos/symfony/mime/zipball/9a0cbd52baa5ba5a5b1f0cacc59466f194730f98", + "reference": "9a0cbd52baa5ba5a5b1f0cacc59466f194730f98", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, @@ -7511,7 +7126,7 @@ "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<5.4", - "symfony/serializer": "<6.2" + "symfony/serializer": "<6.2.13|>=6.3,<6.3.2" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", @@ -7520,7 +7135,7 @@ "symfony/dependency-injection": "^5.4|^6.0", "symfony/property-access": "^5.4|^6.0", "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^6.2" + "symfony/serializer": "~6.2.13|^6.3.2" }, "type": "library", "autoload": { @@ -7552,7 +7167,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.3.0" + "source": "https://github.com/symfony/mime/tree/v6.3.3" }, "funding": [ { @@ -7568,7 +7183,7 @@ "type": "tidelift" } ], - "time": "2023-04-28T15:57:00+00:00" + "time": "2023-07-31T07:08:24+00:00" }, { "name": "symfony/options-resolver", @@ -7639,16 +7254,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -7663,7 +7278,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7701,7 +7316,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -7717,20 +7332,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -7742,7 +7357,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7782,7 +7397,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -7798,20 +7413,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" + "reference": "ecaafce9f77234a6a449d29e49267ba10499116d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/ecaafce9f77234a6a449d29e49267ba10499116d", + "reference": "ecaafce9f77234a6a449d29e49267ba10499116d", "shasum": "" }, "require": { @@ -7825,7 +7440,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7869,7 +7484,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.28.0" }, "funding": [ { @@ -7885,20 +7500,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:30:37+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -7910,7 +7525,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7953,7 +7568,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -7969,20 +7584,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -7997,7 +7612,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8036,7 +7651,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -8052,7 +7667,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php56", @@ -8124,16 +7739,16 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" + "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/70f4aebd92afca2f865444d30a4d2151c13c3179", + "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179", "shasum": "" }, "require": { @@ -8142,7 +7757,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8180,7 +7795,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.28.0" }, "funding": [ { @@ -8196,20 +7811,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -8218,7 +7833,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8263,7 +7878,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -8279,20 +7894,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", - "reference": "508c652ba3ccf69f8c97f251534f229791b52a57" + "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/508c652ba3ccf69f8c97f251534f229791b52a57", - "reference": "508c652ba3ccf69f8c97f251534f229791b52a57", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", + "reference": "b0f46ebbeeeda3e9d2faebdfbf4b4eae9b59fa11", "shasum": "" }, "require": { @@ -8302,7 +7917,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8315,7 +7930,10 @@ ], "psr-4": { "Symfony\\Polyfill\\Php83\\": "" - } + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -8340,7 +7958,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.28.0" }, "funding": [ { @@ -8356,20 +7974,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-08-16T06:22:46+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166" + "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/f3cf1a645c2734236ed1e2e671e273eeb3586166", - "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/9c44518a5aff8da565c8a55dbe85d2769e6f630e", + "reference": "9c44518a5aff8da565c8a55dbe85d2769e6f630e", "shasum": "" }, "require": { @@ -8384,7 +8002,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8422,7 +8040,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.28.0" }, "funding": [ { @@ -8438,20 +8056,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", - "version": "v6.3.0", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628" + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8741e3ed7fe2e91ec099e02446fb86667a0f1628", - "reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628", + "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", "shasum": "" }, "require": { @@ -8483,7 +8101,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.3.0" + "source": "https://github.com/symfony/process/tree/v6.3.4" }, "funding": [ { @@ -8499,25 +8117,26 @@ "type": "tidelift" } ], - "time": "2023-05-19T08:06:44+00:00" + "time": "2023-08-07T10:39:22+00:00" }, { "name": "symfony/psr-http-message-bridge", - "version": "v2.2.0", + "version": "v2.3.1", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "28a732c05bbad801304ad5a5c674cf2970508993" + "reference": "581ca6067eb62640de5ff08ee1ba6850a0ee472e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/28a732c05bbad801304ad5a5c674cf2970508993", - "reference": "28a732c05bbad801304ad5a5c674cf2970508993", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/581ca6067eb62640de5ff08ee1ba6850a0ee472e", + "reference": "581ca6067eb62640de5ff08ee1ba6850a0ee472e", "shasum": "" }, "require": { "php": ">=7.2.5", "psr/http-message": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", "symfony/http-foundation": "^5.4 || ^6.0" }, "require-dev": { @@ -8536,7 +8155,7 @@ "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-main": "2.2-dev" + "dev-main": "2.3-dev" } }, "autoload": { @@ -8571,7 +8190,7 @@ ], "support": { "issues": "https://github.com/symfony/psr-http-message-bridge/issues", - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.2.0" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.3.1" }, "funding": [ { @@ -8587,24 +8206,25 @@ "type": "tidelift" } ], - "time": "2023-04-21T08:40:19+00:00" + "time": "2023-07-26T11:53:26+00:00" }, { "name": "symfony/routing", - "version": "v6.3.1", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "d37ad1779c38b8eb71996d17dc13030dcb7f9cf5" + "reference": "e7243039ab663822ff134fbc46099b5fdfa16f6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/d37ad1779c38b8eb71996d17dc13030dcb7f9cf5", - "reference": "d37ad1779c38b8eb71996d17dc13030dcb7f9cf5", + "url": "https://api.github.com/repos/symfony/routing/zipball/e7243039ab663822ff134fbc46099b5fdfa16f6a", + "reference": "e7243039ab663822ff134fbc46099b5fdfa16f6a", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "doctrine/annotations": "<1.12", @@ -8653,7 +8273,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.3.1" + "source": "https://github.com/symfony/routing/tree/v6.3.3" }, "funding": [ { @@ -8669,7 +8289,7 @@ "type": "tidelift" } ], - "time": "2023-06-05T15:30:22+00:00" + "time": "2023-07-31T07:08:24+00:00" }, { "name": "symfony/service-contracts", @@ -8755,16 +8375,16 @@ }, { "name": "symfony/string", - "version": "v6.3.0", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" + "reference": "53d1a83225002635bca3482fcbf963001313fb68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68", + "reference": "53d1a83225002635bca3482fcbf963001313fb68", "shasum": "" }, "require": { @@ -8821,7 +8441,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.0" + "source": "https://github.com/symfony/string/tree/v6.3.2" }, "funding": [ { @@ -8837,24 +8457,25 @@ "type": "tidelift" } ], - "time": "2023-03-21T21:06:29+00:00" + "time": "2023-07-05T08:41:27+00:00" }, { "name": "symfony/translation", - "version": "v6.3.0", + "version": "v6.3.3", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f72b2cba8f79dd9d536f534f76874b58ad37876f" + "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f72b2cba8f79dd9d536f534f76874b58ad37876f", - "reference": "f72b2cba8f79dd9d536f534f76874b58ad37876f", + "url": "https://api.github.com/repos/symfony/translation/zipball/3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", + "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/translation-contracts": "^2.5|^3.0" }, @@ -8915,7 +8536,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.3.0" + "source": "https://github.com/symfony/translation/tree/v6.3.3" }, "funding": [ { @@ -8931,7 +8552,7 @@ "type": "tidelift" } ], - "time": "2023-05-19T12:46:45+00:00" + "time": "2023-07-31T07:08:24+00:00" }, { "name": "symfony/translation-contracts", @@ -9087,20 +8708,21 @@ }, { "name": "symfony/var-dumper", - "version": "v6.3.1", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c81268d6960ddb47af17391a27d222bd58cf0515" + "reference": "2027be14f8ae8eae999ceadebcda5b4909b81d45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c81268d6960ddb47af17391a27d222bd58cf0515", - "reference": "c81268d6960ddb47af17391a27d222bd58cf0515", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2027be14f8ae8eae999ceadebcda5b4909b81d45", + "reference": "2027be14f8ae8eae999ceadebcda5b4909b81d45", "shasum": "" }, "require": { "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -9109,6 +8731,7 @@ "require-dev": { "ext-iconv": "*", "symfony/console": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", "symfony/process": "^5.4|^6.0", "symfony/uid": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" @@ -9149,7 +8772,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.1" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.4" }, "funding": [ { @@ -9165,7 +8788,7 @@ "type": "tidelift" } ], - "time": "2023-06-21T12:08:28+00:00" + "time": "2023-08-24T14:51:05+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -9762,16 +9385,16 @@ }, { "name": "doctrine/dbal", - "version": "3.6.4", + "version": "3.6.6", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "19f0dec95edd6a3c3c5ff1d188ea94c6b7fc903f" + "reference": "63646ffd71d1676d2f747f871be31b7e921c7864" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/19f0dec95edd6a3c3c5ff1d188ea94c6b7fc903f", - "reference": "19f0dec95edd6a3c3c5ff1d188ea94c6b7fc903f", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/63646ffd71d1676d2f747f871be31b7e921c7864", + "reference": "63646ffd71d1676d2f747f871be31b7e921c7864", "shasum": "" }, "require": { @@ -9786,11 +9409,12 @@ "require-dev": { "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", - "jetbrains/phpstorm-stubs": "2022.3", - "phpstan/phpstan": "1.10.14", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.29", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "9.6.7", + "phpunit/phpunit": "9.6.9", "psalm/plugin-phpunit": "0.18.4", + "slevomat/coding-standard": "8.13.1", "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^5.4|^6.0", "symfony/console": "^4.4|^5.4|^6.0", @@ -9854,7 +9478,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.6.4" + "source": "https://github.com/doctrine/dbal/tree/3.6.6" }, "funding": [ { @@ -9870,7 +9494,7 @@ "type": "tidelift" } ], - "time": "2023-06-15T07:40:12+00:00" + "time": "2023-08-17T05:38:17+00:00" }, { "name": "doctrine/event-manager", @@ -10033,16 +9657,16 @@ }, { "name": "filp/whoops", - "version": "2.15.2", + "version": "2.15.3", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73" + "reference": "c83e88a30524f9360b11f585f71e6b17313b7187" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", - "reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73", + "url": "https://api.github.com/repos/filp/whoops/zipball/c83e88a30524f9360b11f585f71e6b17313b7187", + "reference": "c83e88a30524f9360b11f585f71e6b17313b7187", "shasum": "" }, "require": { @@ -10092,7 +9716,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.2" + "source": "https://github.com/filp/whoops/tree/2.15.3" }, "funding": [ { @@ -10100,7 +9724,7 @@ "type": "github" } ], - "time": "2023-04-12T12:00:00+00:00" + "time": "2023-07-13T12:00:00+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -10187,16 +9811,16 @@ }, { "name": "laravel/pint", - "version": "v1.10.3", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "c472786bca01e4812a9bb7933b23edfc5b6877b7" + "reference": "08bcf51e520a5e5aea458fc600ac4869f6934a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/c472786bca01e4812a9bb7933b23edfc5b6877b7", - "reference": "c472786bca01e4812a9bb7933b23edfc5b6877b7", + "url": "https://api.github.com/repos/laravel/pint/zipball/08bcf51e520a5e5aea458fc600ac4869f6934a66", + "reference": "08bcf51e520a5e5aea458fc600ac4869f6934a66", "shasum": "" }, "require": { @@ -10207,9 +9831,9 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.18.0", + "friendsofphp/php-cs-fixer": "^3.21.1", "illuminate/view": "^10.5.1", - "laravel-zero/framework": "^10.0.2", + "laravel-zero/framework": "^10.1.2", "mockery/mockery": "^1.5.1", "nunomaduro/larastan": "^2.5.1", "nunomaduro/termwind": "^1.15.1", @@ -10249,20 +9873,20 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2023-06-20T15:55:03+00:00" + "time": "2023-08-30T07:53:32+00:00" }, { "name": "laravel/tinker", - "version": "v2.8.1", + "version": "v2.8.2", "source": { "type": "git", "url": "https://github.com/laravel/tinker.git", - "reference": "04a2d3bd0d650c0764f70bf49d1ee39393e4eb10" + "reference": "b936d415b252b499e8c3b1f795cd4fc20f57e1f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/04a2d3bd0d650c0764f70bf49d1ee39393e4eb10", - "reference": "04a2d3bd0d650c0764f70bf49d1ee39393e4eb10", + "url": "https://api.github.com/repos/laravel/tinker/zipball/b936d415b252b499e8c3b1f795cd4fc20f57e1f3", + "reference": "b936d415b252b499e8c3b1f795cd4fc20f57e1f3", "shasum": "" }, "require": { @@ -10275,6 +9899,7 @@ }, "require-dev": { "mockery/mockery": "~1.3.3|^1.4.2", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^8.5.8|^9.3.3" }, "suggest": { @@ -10315,43 +9940,39 @@ ], "support": { "issues": "https://github.com/laravel/tinker/issues", - "source": "https://github.com/laravel/tinker/tree/v2.8.1" + "source": "https://github.com/laravel/tinker/tree/v2.8.2" }, - "time": "2023-02-15T16:40:09+00:00" + "time": "2023-08-15T14:27:00+00:00" }, { "name": "mockery/mockery", - "version": "1.6.2", + "version": "1.6.6", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "13a7fa2642c76c58fa2806ef7f565344c817a191" + "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/13a7fa2642c76c58fa2806ef7f565344c817a191", - "reference": "13a7fa2642c76c58fa2806ef7f565344c817a191", + "url": "https://api.github.com/repos/mockery/mockery/zipball/b8e0bb7d8c604046539c1115994632c74dcb361e", + "reference": "b8e0bb7d8c604046539c1115994632c74dcb361e", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": "^7.4 || ^8.0" + "php": ">=7.3" }, "conflict": { "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3", - "psalm/plugin-phpunit": "^0.18", - "vimeo/psalm": "^5.9" + "phpunit/phpunit": "^8.5 || ^9.6.10", + "psalm/plugin-phpunit": "^0.18.4", + "symplify/easy-coding-standard": "^11.5.0", + "vimeo/psalm": "^4.30" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.6.x-dev" - } - }, "autoload": { "files": [ "library/helpers.php", @@ -10369,12 +9990,20 @@ { "name": "Pádraic Brady", "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" + "homepage": "https://github.com/padraic", + "role": "Author" }, { "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], "description": "Mockery is a simple yet flexible PHP mock object framework", @@ -10392,10 +10021,13 @@ "testing" ], "support": { + "docs": "https://docs.mockery.io/", "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.6.2" + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, - "time": "2023-06-07T09:07:52+00:00" + "time": "2023-08-09T00:03:52+00:00" }, { "name": "myclabs/deep-copy", @@ -10458,38 +10090,35 @@ }, { "name": "nunomaduro/collision", - "version": "v7.7.0", + "version": "v7.8.1", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "69a07197d055456d29911116fca3bc2c985f524b" + "reference": "61553ad3260845d7e3e49121b7074619233d361b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/69a07197d055456d29911116fca3bc2c985f524b", - "reference": "69a07197d055456d29911116fca3bc2c985f524b", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/61553ad3260845d7e3e49121b7074619233d361b", + "reference": "61553ad3260845d7e3e49121b7074619233d361b", "shasum": "" }, "require": { - "filp/whoops": "^2.15.2", + "filp/whoops": "^2.15.3", "nunomaduro/termwind": "^1.15.1", "php": "^8.1.0", - "symfony/console": "^6.3.0" - }, - "conflict": { - "phpunit/phpunit": "<10.1.2" + "symfony/console": "^6.3.2" }, "require-dev": { - "brianium/paratest": "^7.2.2", - "laravel/framework": "^10.14.1", - "laravel/pint": "^1.10.3", - "laravel/sail": "^1.23.0", + "brianium/paratest": "^7.2.4", + "laravel/framework": "^10.17.1", + "laravel/pint": "^1.10.5", + "laravel/sail": "^1.23.1", "laravel/sanctum": "^3.2.5", "laravel/tinker": "^2.8.1", - "nunomaduro/larastan": "^2.6.3", - "orchestra/testbench-core": "^8.5.8", - "pestphp/pest": "^2.8.1", - "phpunit/phpunit": "^10.2.2", + "nunomaduro/larastan": "^2.6.4", + "orchestra/testbench-core": "^8.5.9", + "pestphp/pest": "^2.12.1", + "phpunit/phpunit": "^10.3.1", "sebastian/environment": "^6.0.1", "spatie/laravel-ignition": "^2.2.0" }, @@ -10550,20 +10179,20 @@ "type": "patreon" } ], - "time": "2023-06-29T09:10:16+00:00" + "time": "2023-08-07T08:03:21+00:00" }, { "name": "nunomaduro/larastan", - "version": "v2.6.3", + "version": "v2.6.4", "source": { "type": "git", "url": "https://github.com/nunomaduro/larastan.git", - "reference": "73e5be5f5c732212ce6ca77ffd2753a136f36a23" + "reference": "6c5e8820f3db6397546f3ce48520af9d312aed27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/73e5be5f5c732212ce6ca77ffd2753a136f36a23", - "reference": "73e5be5f5c732212ce6ca77ffd2753a136f36a23", + "url": "https://api.github.com/repos/nunomaduro/larastan/zipball/6c5e8820f3db6397546f3ce48520af9d312aed27", + "reference": "6c5e8820f3db6397546f3ce48520af9d312aed27", "shasum": "" }, "require": { @@ -10626,7 +10255,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/larastan/issues", - "source": "https://github.com/nunomaduro/larastan/tree/v2.6.3" + "source": "https://github.com/nunomaduro/larastan/tree/v2.6.4" }, "funding": [ { @@ -10646,7 +10275,7 @@ "type": "patreon" } ], - "time": "2023-06-13T21:39:27+00:00" + "time": "2023-07-29T12:13:13+00:00" }, { "name": "phar-io/manifest", @@ -10848,16 +10477,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.25", + "version": "1.10.33", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "578f4e70d117f9a90699324c555922800ac38d8c" + "reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/578f4e70d117f9a90699324c555922800ac38d8c", - "reference": "578f4e70d117f9a90699324c555922800ac38d8c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1", + "reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1", "shasum": "" }, "require": { @@ -10906,20 +10535,20 @@ "type": "tidelift" } ], - "time": "2023-07-06T12:11:37+00:00" + "time": "2023-09-04T12:20:53+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "10.1.2", + "version": "10.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "db1497ec8dd382e82c962f7abbe0320e4882ee4e" + "reference": "cd59bb34756a16ca8253ce9b2909039c227fff71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/db1497ec8dd382e82c962f7abbe0320e4882ee4e", - "reference": "db1497ec8dd382e82c962f7abbe0320e4882ee4e", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cd59bb34756a16ca8253ce9b2909039c227fff71", + "reference": "cd59bb34756a16ca8253ce9b2909039c227fff71", "shasum": "" }, "require": { @@ -10976,7 +10605,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.2" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.4" }, "funding": [ { @@ -10984,20 +10613,20 @@ "type": "github" } ], - "time": "2023-05-22T09:04:27+00:00" + "time": "2023-08-31T14:04:38+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "4.0.2", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "5647d65443818959172645e7ed999217360654b6" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/5647d65443818959172645e7ed999217360654b6", - "reference": "5647d65443818959172645e7ed999217360654b6", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { @@ -11037,7 +10666,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.2" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -11045,7 +10674,7 @@ "type": "github" } ], - "time": "2023-05-07T09:13:23+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", @@ -11112,16 +10741,16 @@ }, { "name": "phpunit/php-text-template", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { @@ -11159,7 +10788,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -11167,7 +10797,7 @@ "type": "github" } ], - "time": "2023-02-03T06:56:46+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", @@ -11230,16 +10860,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.2.3", + "version": "10.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "35c8cac1734ede2ae354a6644f7088356ff5b08e" + "reference": "241ed4dd0db1c096984e62d414c4e1ac8d5dbff4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/35c8cac1734ede2ae354a6644f7088356ff5b08e", - "reference": "35c8cac1734ede2ae354a6644f7088356ff5b08e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/241ed4dd0db1c096984e62d414c4e1ac8d5dbff4", + "reference": "241ed4dd0db1c096984e62d414c4e1ac8d5dbff4", "shasum": "" }, "require": { @@ -11264,7 +10894,7 @@ "sebastian/diff": "^5.0", "sebastian/environment": "^6.0", "sebastian/exporter": "^5.0", - "sebastian/global-state": "^6.0", + "sebastian/global-state": "^6.0.1", "sebastian/object-enumerator": "^5.0", "sebastian/recursion-context": "^5.0", "sebastian/type": "^4.0", @@ -11279,7 +10909,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.2-dev" + "dev-main": "10.3-dev" } }, "autoload": { @@ -11311,7 +10941,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.2.3" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.3.3" }, "funding": [ { @@ -11327,7 +10957,7 @@ "type": "tidelift" } ], - "time": "2023-06-30T06:17:38+00:00" + "time": "2023-09-05T04:34:51+00:00" }, { "name": "psr/cache", @@ -11380,16 +11010,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.18", + "version": "v0.11.20", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "4f00ee9e236fa6a48f4560d1300b9c961a70a7ec" + "reference": "0fa27040553d1d280a67a4393194df5228afea5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4f00ee9e236fa6a48f4560d1300b9c961a70a7ec", - "reference": "4f00ee9e236fa6a48f4560d1300b9c961a70a7ec", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/0fa27040553d1d280a67a4393194df5228afea5b", + "reference": "0fa27040553d1d280a67a4393194df5228afea5b", "shasum": "" }, "require": { @@ -11450,9 +11080,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.18" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.20" }, - "time": "2023-05-23T02:31:11+00:00" + "time": "2023-07-31T14:32:22+00:00" }, { "name": "sebastian/cli-parser", @@ -11623,16 +11253,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "shasum": "" }, "require": { @@ -11643,7 +11273,7 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.3" }, "type": "library", "extra": { @@ -11687,7 +11317,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -11695,20 +11326,20 @@ "type": "github" } ], - "time": "2023-02-03T07:07:16+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" + "reference": "c70b73893e10757af9c6a48929fa6a333b56a97a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c70b73893e10757af9c6a48929fa6a333b56a97a", + "reference": "c70b73893e10757af9c6a48929fa6a333b56a97a", "shasum": "" }, "require": { @@ -11744,7 +11375,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.1" }, "funding": [ { @@ -11752,7 +11384,7 @@ "type": "github" } ], - "time": "2023-02-03T06:59:47+00:00" + "time": "2023-08-31T09:55:53+00:00" }, { "name": "sebastian/diff", @@ -11964,16 +11596,16 @@ }, { "name": "sebastian/global-state", - "version": "6.0.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "aab257c712de87b90194febd52e4d184551c2d44" + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", - "reference": "aab257c712de87b90194febd52e4d184551c2d44", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", "shasum": "" }, "require": { @@ -12013,7 +11645,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" }, "funding": [ { @@ -12021,20 +11654,20 @@ "type": "github" } ], - "time": "2023-02-03T07:07:38+00:00" + "time": "2023-07-19T07:19:23+00:00" }, { "name": "sebastian/lines-of-code", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/649e40d279e243d985aa8fb6e74dd5bb28dc185d", + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d", "shasum": "" }, "require": { @@ -12070,7 +11703,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.1" }, "funding": [ { @@ -12078,7 +11712,7 @@ "type": "github" } ], - "time": "2023-02-03T07:08:02+00:00" + "time": "2023-08-31T09:25:50+00:00" }, { "name": "sebastian/object-enumerator", @@ -12603,16 +12237,16 @@ }, { "name": "spatie/flare-client-php", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/spatie/flare-client-php.git", - "reference": "943894c6a6b00501365ac0b91ae0dce56f2226fa" + "reference": "5f2c6a7a0d2c1d90c12559dc7828fd942911a544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/943894c6a6b00501365ac0b91ae0dce56f2226fa", - "reference": "943894c6a6b00501365ac0b91ae0dce56f2226fa", + "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/5f2c6a7a0d2c1d90c12559dc7828fd942911a544", + "reference": "5f2c6a7a0d2c1d90c12559dc7828fd942911a544", "shasum": "" }, "require": { @@ -12661,7 +12295,7 @@ ], "support": { "issues": "https://github.com/spatie/flare-client-php/issues", - "source": "https://github.com/spatie/flare-client-php/tree/1.4.1" + "source": "https://github.com/spatie/flare-client-php/tree/1.4.2" }, "funding": [ { @@ -12669,20 +12303,20 @@ "type": "github" } ], - "time": "2023-07-06T09:29:49+00:00" + "time": "2023-07-28T08:07:24+00:00" }, { "name": "spatie/ignition", - "version": "1.9.0", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/spatie/ignition.git", - "reference": "de24ff1e01814d5043bd6eb4ab36a5a852a04973" + "reference": "d92b9a081e99261179b63a858c7a4b01541e7dd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ignition/zipball/de24ff1e01814d5043bd6eb4ab36a5a852a04973", - "reference": "de24ff1e01814d5043bd6eb4ab36a5a852a04973", + "url": "https://api.github.com/repos/spatie/ignition/zipball/d92b9a081e99261179b63a858c7a4b01541e7dd1", + "reference": "d92b9a081e99261179b63a858c7a4b01541e7dd1", "shasum": "" }, "require": { @@ -12752,20 +12386,20 @@ "type": "github" } ], - "time": "2023-06-28T13:24:59+00:00" + "time": "2023-08-21T15:06:37+00:00" }, { "name": "spatie/laravel-ignition", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ignition.git", - "reference": "dd15fbe82ef5392798941efae93c49395a87d943" + "reference": "4ed813d16edb5a1ab0d7f4b1d116c37ee8cdf3c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/dd15fbe82ef5392798941efae93c49395a87d943", - "reference": "dd15fbe82ef5392798941efae93c49395a87d943", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/4ed813d16edb5a1ab0d7f4b1d116c37ee8cdf3c0", + "reference": "4ed813d16edb5a1ab0d7f4b1d116c37ee8cdf3c0", "shasum": "" }, "require": { @@ -12844,7 +12478,7 @@ "type": "github" } ], - "time": "2023-06-28T13:51:52+00:00" + "time": "2023-08-23T06:24:34+00:00" }, { "name": "symfony/filesystem", diff --git a/config/app.php b/config/app.php index 87867bcd9..2a604bf23 100644 --- a/config/app.php +++ b/config/app.php @@ -174,7 +174,6 @@ // Application Service Providers... App\Providers\AppServiceProvider::class, - App\Providers\RepositoryServiceProvider::class, App\Providers\AuthServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, diff --git a/config/explorer.php b/config/explorer.php deleted file mode 100644 index a94b23576..000000000 --- a/config/explorer.php +++ /dev/null @@ -1,31 +0,0 @@ - [ - 'host' => Env::get('ELASTICSEARCH_HOST', 'elasticsearch'), - ], - - /* - * An index may be defined on an Eloquent model or inline below. A more in depth explanation - * of the mapping possibilities can be found in the documentation of Explorer's repository. - */ - 'indexes' => [ - Product::class, - ], - - /* - * You may opt to keep the old indices after the alias is pointed to a new index. - * A model is only using index aliases if it implements the Aliased interface. - */ - 'prune_old_aliases' => true, -]; diff --git a/config/furgonetka.php b/config/furgonetka.php deleted file mode 100644 index da0504649..000000000 --- a/config/furgonetka.php +++ /dev/null @@ -1,19 +0,0 @@ - env('FURGONETKA_ENABLED', false), - - 'webhook_salt' => env('FURGONETKA_WEBHOOK_SALT', 'tajnasól'), - - 'login' => env('FURGONETKA_LOGIN', 'login@example.com'), - - 'password' => env('FURGONETKA_PASSWORD', 'secret'), - - 'auth_url' => env('FURGONETKA_AUTH_URL', 'https://konto-test.furgonetka.pl'), - - 'api_url' => env('FURGONETKA_API_URL', 'http://biznes-test.furgonetka.pl/api/soap/v2?wsdl'), - - 'client_id' => env('FURGONETKA_CLIENT_ID', 'client-id'), - - 'client_secret' => env('FURGONETKA_CLIENT_SECRET', 'clientsecret'), -]; diff --git a/config/scout.php b/config/scout.php deleted file mode 100644 index 27eeae3de..000000000 --- a/config/scout.php +++ /dev/null @@ -1,99 +0,0 @@ - env('SCOUT_DRIVER', 'database'), - - /* - |-------------------------------------------------------------------------- - | Index Prefix - |-------------------------------------------------------------------------- - | - | Here you may specify a prefix that will be applied to all search index - | names used by Scout. This prefix may be useful if you have multiple - | "tenants" or applications sharing the same search infrastructure. - | - */ - - 'prefix' => env('SCOUT_PREFIX', ''), - - /* - |-------------------------------------------------------------------------- - | Queue Data Syncing - |-------------------------------------------------------------------------- - | - | This option allows you to control if the operations that sync your data - | with your search engines are queued. When this is set to "true" then - | all automatic data syncing will get queued for better performance. - | - */ - - 'queue' => env('SCOUT_QUEUE', false), - - /* - |-------------------------------------------------------------------------- - | Database Transactions - |-------------------------------------------------------------------------- - | - | This configuration option determines if your data will only be synced - | with your search indexes after every open database transaction has - | been committed, thus preventing any discarded data from syncing. - | - */ - - 'after_commit' => false, - - /* - |-------------------------------------------------------------------------- - | Chunk Sizes - |-------------------------------------------------------------------------- - | - | These options allow you to control the maximum chunk size when you are - | mass importing data into the search engine. This allows you to fine - | tune each of these chunk sizes based on the power of the servers. - | - */ - - 'chunk' => [ - 'searchable' => 500, - 'unsearchable' => 500, - ], - - /* - |-------------------------------------------------------------------------- - | Soft Deletes - |-------------------------------------------------------------------------- - | - | This option allows to control whether to keep soft deleted records in - | the search indexes. Maintaining soft deleted records can be useful - | if your application still needs to search for the records later. - | - */ - - 'soft_delete' => false, - - /* - |-------------------------------------------------------------------------- - | Identify User - |-------------------------------------------------------------------------- - | - | This option allows you to control whether to notify the search engine - | of the user performing the search. This is sometimes useful if the - | engine supports any analytics based on this application's users. - | - | Supported engines: "algolia" - | - */ - - 'identify' => env('SCOUT_IDENTIFY', false), -]; diff --git a/config/view.php b/config/view.php index b6f3a4c0c..206a8def4 100644 --- a/config/view.php +++ b/config/view.php @@ -29,6 +29,6 @@ 'compiled' => env( 'VIEW_COMPILED_PATH', - realpath(storage_path('framework/views')) + realpath(storage_path('framework/views')), ), ]; diff --git a/database/migrations/2021_03_30_195459_create_discounts_table.php b/database/migrations/2021_03_30_195459_create_discounts_table.php index df1a080b4..ccf8facb4 100755 --- a/database/migrations/2021_03_30_195459_create_discounts_table.php +++ b/database/migrations/2021_03_30_195459_create_discounts_table.php @@ -34,6 +34,7 @@ public function up(): void public function down(): void { + Schema::dropIfExists('order_discounts'); Schema::dropIfExists('discounts'); } } diff --git a/database/migrations/2021_04_04_100123_add_user_agent_and_ip_to_oauth_access_tokens_table.php b/database/migrations/2021_04_04_100123_add_user_agent_and_ip_to_oauth_access_tokens_table.php index 3f9bbc2ed..4571c11d0 100755 --- a/database/migrations/2021_04_04_100123_add_user_agent_and_ip_to_oauth_access_tokens_table.php +++ b/database/migrations/2021_04_04_100123_add_user_agent_and_ip_to_oauth_access_tokens_table.php @@ -16,11 +16,17 @@ public function up(): void public function down(): void { - Schema::table('oauth_access_tokens', function (Blueprint $table): void { - $table->dropColumn([ - 'ip', - 'user_agent', - ]); - }); + if (Schema::hasTable('oauth_access_tokens')) { + if (Schema::hasColumn('oauth_access_tokens', 'ip')) { + Schema::table('oauth_access_tokens', function (Blueprint $table): void { + $table->dropColumn('ip'); + }); + } + if (Schema::hasColumn('oauth_access_tokens', 'user_agent')) { + Schema::table('oauth_access_tokens', function (Blueprint $table): void { + $table->dropColumn('user_agent'); + }); + } + } } } diff --git a/database/migrations/2021_04_16_220351_add_order.php b/database/migrations/2021_04_16_220351_add_order.php index 4faaf9e77..2d8e3d42d 100755 --- a/database/migrations/2021_04_16_220351_add_order.php +++ b/database/migrations/2021_04_16_220351_add_order.php @@ -31,24 +31,34 @@ public function up(): void public function down(): void { - Schema::table('categories', function (Blueprint $table): void { - $table->dropColumn('order'); - }); + if (Schema::hasTable('categories') && Schema::hasColumn('categories', 'order')) { + Schema::table('categories', function (Blueprint $table): void { + $table->dropColumn('order'); + }); + } - Schema::table('brands', function (Blueprint $table): void { - $table->dropColumn('order'); - }); + if (Schema::hasTable('brands') && Schema::hasColumn('brands', 'order')) { + Schema::table('brands', function (Blueprint $table): void { + $table->dropColumn('order'); + }); + } - Schema::table('product_schemas', function (Blueprint $table): void { - $table->dropColumn('order'); - }); + if (Schema::hasTable('product_schemas') && Schema::hasColumn('product_schemas', 'order')) { + Schema::table('product_schemas', function (Blueprint $table): void { + $table->dropColumn('order'); + }); + } - Schema::table('shipping_methods', function (Blueprint $table): void { - $table->dropColumn('order'); - }); + if (Schema::hasTable('shipping_methods') && Schema::hasColumn('shipping_methods', 'order')) { + Schema::table('shipping_methods', function (Blueprint $table): void { + $table->dropColumn('order'); + }); + } - Schema::table('statuses', function (Blueprint $table): void { - $table->dropColumn('order'); - }); + if (Schema::hasTable('statuses') && Schema::hasColumn('statuses', 'order')) { + Schema::table('statuses', function (Blueprint $table): void { + $table->dropColumn('order'); + }); + } } } diff --git a/database/migrations/2021_04_17_014444_add_hide_on_index_to_brands_and_categories_table.php b/database/migrations/2021_04_17_014444_add_hide_on_index_to_brands_and_categories_table.php index 98ab4c34c..949c3e7b7 100755 --- a/database/migrations/2021_04_17_014444_add_hide_on_index_to_brands_and_categories_table.php +++ b/database/migrations/2021_04_17_014444_add_hide_on_index_to_brands_and_categories_table.php @@ -19,12 +19,16 @@ public function up(): void public function down(): void { - Schema::table('brands', function (Blueprint $table): void { - $table->dropColumn('hide_on_index'); - }); + if (Schema::hasTable('brands') && Schema::hasColumn('brands', 'hide_on_index')) { + Schema::table('brands', function (Blueprint $table): void { + $table->dropColumn('hide_on_index'); + }); + } - Schema::table('categories', function (Blueprint $table): void { - $table->dropColumn('hide_on_index'); - }); + if (Schema::hasTable('categories') && Schema::hasColumn('categories', 'hide_on_index')) { + Schema::table('categories', function (Blueprint $table): void { + $table->dropColumn('hide_on_index'); + }); + } } } diff --git a/database/migrations/2021_07_21_082101_change_order_type_for_pages_table.php b/database/migrations/2021_07_21_082101_change_order_type_for_pages_table.php index ea84a2628..bae40a973 100755 --- a/database/migrations/2021_07_21_082101_change_order_type_for_pages_table.php +++ b/database/migrations/2021_07_21_082101_change_order_type_for_pages_table.php @@ -15,8 +15,8 @@ public function up(): void public function down(): void { - Schema::table('pages', function (Blueprint $table): void { - $table->unsignedTinyInteger('order')->default(0)->change(); - }); + // Schema::table('pages', function (Blueprint $table): void { + // $table->unsignedTinyInteger('order')->default(0)->change(); + // }); } } diff --git a/database/migrations/2021_07_21_084302_change_order_type_for_shipping_methods_table.php b/database/migrations/2021_07_21_084302_change_order_type_for_shipping_methods_table.php index 3f3b4c7b4..a5ccb01e4 100755 --- a/database/migrations/2021_07_21_084302_change_order_type_for_shipping_methods_table.php +++ b/database/migrations/2021_07_21_084302_change_order_type_for_shipping_methods_table.php @@ -15,8 +15,8 @@ public function up(): void public function down(): void { - Schema::table('shipping_methods', function (Blueprint $table): void { - $table->unsignedTinyInteger('order')->default(0)->change(); - }); + // Schema::table('shipping_methods', function (Blueprint $table): void { + // $table->unsignedTinyInteger('order')->default(0)->change(); + // }); } } diff --git a/database/migrations/2021_08_16_113956_create_permission_tables.php b/database/migrations/2021_08_16_113956_create_permission_tables.php index 02542943e..fca9656e1 100755 --- a/database/migrations/2021_08_16_113956_create_permission_tables.php +++ b/database/migrations/2021_08_16_113956_create_permission_tables.php @@ -50,7 +50,7 @@ public function up(): void $table->primary( ['permission_id', $columnNames['model_morph_key'], 'model_type'], - 'model_has_permissions_permission_model_type_primary' + 'model_has_permissions_permission_model_type_primary', ); }); @@ -68,7 +68,7 @@ public function up(): void $table->primary( ['role_id', $columnNames['model_morph_key'], 'model_type'], - 'model_has_roles_role_model_type_primary' + 'model_has_roles_role_model_type_primary', ); }); diff --git a/database/migrations/2021_11_02_083134_insert_products_seo_metadata.php b/database/migrations/2021_11_02_083134_insert_products_seo_metadata.php index 8b394b727..2788c5335 100755 --- a/database/migrations/2021_11_02_083134_insert_products_seo_metadata.php +++ b/database/migrations/2021_11_02_083134_insert_products_seo_metadata.php @@ -18,8 +18,8 @@ public function up(): void 'global' => false, 'model_id' => $product->id, 'model_type' => Product::class, - ]) - ) + ]), + ), ); } } diff --git a/database/migrations/2021_11_12_083138_add_user_to_orders_table.php b/database/migrations/2021_11_12_083138_add_user_to_orders_table.php index aa02a6259..95c766817 100755 --- a/database/migrations/2021_11_12_083138_add_user_to_orders_table.php +++ b/database/migrations/2021_11_12_083138_add_user_to_orders_table.php @@ -18,9 +18,9 @@ public function up(): void public function down(): void { Schema::table('orders', function (Blueprint $table): void { - $table->dropForeign('orders_user_id_foreign'); - - $table->dropColumn('user_id'); + // $table->dropForeign('orders_user_id_foreign'); + // + // $table->dropColumn('user_id'); }); } } diff --git a/database/migrations/2021_11_17_072028_insert_pages_seo_metadata.php b/database/migrations/2021_11_17_072028_insert_pages_seo_metadata.php index a3d2f98e5..960bfed94 100755 --- a/database/migrations/2021_11_17_072028_insert_pages_seo_metadata.php +++ b/database/migrations/2021_11_17_072028_insert_pages_seo_metadata.php @@ -16,7 +16,7 @@ public function up(): void 'global' => false, 'model_id' => $page->getKey(), 'model_type' => Page::class, - ]) + ]), )); } } diff --git a/database/migrations/2021_11_17_120011_insert_product_sets_seo_metadata.php b/database/migrations/2021_11_17_120011_insert_product_sets_seo_metadata.php index 0e71cb46e..a873c7984 100755 --- a/database/migrations/2021_11_17_120011_insert_product_sets_seo_metadata.php +++ b/database/migrations/2021_11_17_120011_insert_product_sets_seo_metadata.php @@ -3,6 +3,7 @@ use App\Models\ProductSet; use App\Models\SeoMetadata; use Illuminate\Database\Migrations\Migration; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; class InsertProductSetsSeoMetadata extends Migration @@ -15,7 +16,7 @@ public function up(): void 'global' => false, 'model_id' => $set->getKey(), 'model_type' => ProductSet::class, - ]) + ]), )); } } diff --git a/database/migrations/2021_11_19_095045_seed_roles_and_permissions.php b/database/migrations/2021_11_19_095045_seed_roles_and_permissions.php index f7a9f03b1..c7db625cd 100755 --- a/database/migrations/2021_11_19_095045_seed_roles_and_permissions.php +++ b/database/migrations/2021_11_19_095045_seed_roles_and_permissions.php @@ -210,7 +210,7 @@ public function up(): void public function down(): void { - Permission::delete(); - Role::delete(); + Permission::query()->delete(); + Role::query()->delete(); } } diff --git a/database/migrations/2021_11_26_094412_precalculate_product_visibility.php b/database/migrations/2021_11_26_094412_precalculate_product_visibility.php index 00b896546..acff03a91 100755 --- a/database/migrations/2021_11_26_094412_precalculate_product_visibility.php +++ b/database/migrations/2021_11_26_094412_precalculate_product_visibility.php @@ -35,7 +35,7 @@ public function down(): void { Product::chunk(100, fn (Collection $products) => $products->each( fn (Product $product) => $product->update([ - 'public' => $product->public_legacy, + 'public' => $product->public_legacy ?? false, ]), )); diff --git a/database/migrations/2021_12_03_082833_add_summary_to_orders_table.php b/database/migrations/2021_12_03_082833_add_summary_to_orders_table.php index a6a12ea72..8f79e851a 100755 --- a/database/migrations/2021_12_03_082833_add_summary_to_orders_table.php +++ b/database/migrations/2021_12_03_082833_add_summary_to_orders_table.php @@ -23,7 +23,7 @@ public function up(): void fn (Order $order) => $order->update([ 'summary' => $orderService->calcSummary($order), 'paid' => $order->paid_amount >= $orderService->calcSummary($order), - ]) + ]), )); } diff --git a/database/migrations/2021_12_10_090917_add_cover_to_product_sets_table.php b/database/migrations/2021_12_10_090917_add_cover_to_product_sets_table.php index a7814a662..a4d8dd6a6 100755 --- a/database/migrations/2021_12_10_090917_add_cover_to_product_sets_table.php +++ b/database/migrations/2021_12_10_090917_add_cover_to_product_sets_table.php @@ -17,6 +17,7 @@ public function up(): void public function down(): void { Schema::table('product_sets', function (Blueprint $table): void { + $table->dropForeign('product_sets_cover_id_foreign'); $table->dropColumn('cover_id'); }); } diff --git a/database/migrations/2022_01_11_102504_add_quantity_to_items_table.php b/database/migrations/2022_01_11_102504_add_quantity_to_items_table.php index 65b72b657..49eaa0f3f 100755 --- a/database/migrations/2022_01_11_102504_add_quantity_to_items_table.php +++ b/database/migrations/2022_01_11_102504_add_quantity_to_items_table.php @@ -16,7 +16,7 @@ public function up(): void Item::chunk(100, fn ($item) => $item->each( fn (Item $item) => $item->update([ 'quantity' => $item->deposits->sum('quantity'), - ]) + ]), )); } diff --git a/database/migrations/2022_01_28_103745_add_authenticated_role.php b/database/migrations/2022_01_28_103745_add_authenticated_role.php index 3812fdd9b..378a8a76e 100755 --- a/database/migrations/2022_01_28_103745_add_authenticated_role.php +++ b/database/migrations/2022_01_28_103745_add_authenticated_role.php @@ -20,7 +20,7 @@ public function up(): void public function down(): void { - $authenticated = Role::where('type', '=', RoleType::AUTHENTICATED); + $authenticated = Role::where('type', '=', RoleType::AUTHENTICATED)->first(); foreach (User::all() as $user) { $user->removeRole($authenticated); } diff --git a/database/migrations/2022_02_08_112923_remove_seo_show_permission.php b/database/migrations/2022_02_08_112923_remove_seo_show_permission.php index 961500254..83b21991c 100755 --- a/database/migrations/2022_02_08_112923_remove_seo_show_permission.php +++ b/database/migrations/2022_02_08_112923_remove_seo_show_permission.php @@ -22,13 +22,13 @@ public function down(): void { Permission::create(['name' => 'seo.show', 'display_name' => 'Dostęp do ustawień SEO sklepu']); - $owner = Role::find('type', RoleType::OWNER); + $owner = Role::where('type', RoleType::OWNER)->first(); $owner->givePermissionTo([ 'seo.show', ]); $owner->save(); - $unauthenticated = Role::find('type', RoleType::UNAUTHENTICATED); + $unauthenticated = Role::where('type', RoleType::UNAUTHENTICATED)->first(); $unauthenticated->givePermissionTo([ 'seo.show', ]); diff --git a/database/migrations/2022_02_09_106647_add_user_type_to_orders_table.php b/database/migrations/2022_02_09_106647_add_user_type_to_orders_table.php index c7eefcc56..1045019f5 100755 --- a/database/migrations/2022_02_09_106647_add_user_type_to_orders_table.php +++ b/database/migrations/2022_02_09_106647_add_user_type_to_orders_table.php @@ -19,9 +19,9 @@ public function up(): void public function down(): void { Schema::table('orders', function (Blueprint $table): void { + $table->dropIndex('orders_user_id_user_type_index'); $table->dropColumn('user_type'); $table->dropColumn('user_id'); - $table->dropIndex('orders_user_id_user_type_index'); }); } } diff --git a/database/migrations/2022_02_17_092024_add_profile_permission_and_add_it_to_authenticated_role.php b/database/migrations/2022_02_17_092024_add_profile_permission_and_add_it_to_authenticated_role.php index 142766795..964395f1e 100644 --- a/database/migrations/2022_02_17_092024_add_profile_permission_and_add_it_to_authenticated_role.php +++ b/database/migrations/2022_02_17_092024_add_profile_permission_and_add_it_to_authenticated_role.php @@ -41,7 +41,7 @@ public function down(): void ]); $owner->save(); - Permission::delete(); - Role::delete(); + Permission::findByName('profile.addresses_manage')->delete(); + // Role::delete(); } } diff --git a/database/migrations/2022_02_25_124028_change_discounts_table.php b/database/migrations/2022_02_25_124028_change_discounts_table.php index c7420ec45..b99f651e0 100755 --- a/database/migrations/2022_02_25_124028_change_discounts_table.php +++ b/database/migrations/2022_02_25_124028_change_discounts_table.php @@ -76,7 +76,7 @@ function (Discount $discount): void { } $discount->conditionGroups()->attach($conditionGroup); - } + }, )); Schema::table('discounts', function (Blueprint $table): void { @@ -118,7 +118,7 @@ function (Discount $discount): void { 'expires_at' => $expiresAt, ]); $discount->conditionGroups()->delete(); - } + }, )); Schema::dropIfExists('model_has_discounts'); diff --git a/database/migrations/2022_03_11_114754_add_columns_to_shipping_method_table_and_create_address_shipping_method_table.php b/database/migrations/2022_03_11_114754_add_columns_to_shipping_method_table_and_create_address_shipping_method_table.php index 3b1f71f7d..79ae283fa 100644 --- a/database/migrations/2022_03_11_114754_add_columns_to_shipping_method_table_and_create_address_shipping_method_table.php +++ b/database/migrations/2022_03_11_114754_add_columns_to_shipping_method_table_and_create_address_shipping_method_table.php @@ -37,6 +37,8 @@ public function up(): void public function down(): void { Schema::table('shipping_methods', function (Blueprint $table): void { + $table->dropForeign('shipping_methods_app_id_foreign'); + $table->dropColumn('shipping_type'); $table->dropColumn('integration_key'); $table->dropColumn('app_id'); diff --git a/database/migrations/2022_03_24_092349_create_product_attribute_attribute_option_table.php b/database/migrations/2022_03_24_092349_create_product_attribute_attribute_option_table.php index cddf5dcb6..01f6ba210 100755 --- a/database/migrations/2022_03_24_092349_create_product_attribute_attribute_option_table.php +++ b/database/migrations/2022_03_24_092349_create_product_attribute_attribute_option_table.php @@ -40,7 +40,7 @@ public function down(): void $table->primary(['product_id', 'attribute_id']); $table->uuid('option_id'); - $table->foreign('option_id')->references('id')->on('attribute_options')->onDelete('cascade'); + // $table->foreign('option_id')->references('id')->on('attribute_options')->onDelete('cascade'); }); } } diff --git a/database/migrations/2022_04_08_100242_create_consents_table.php b/database/migrations/2022_04_08_100242_create_consents_table.php index 745636603..7edc6c1eb 100755 --- a/database/migrations/2022_04_08_100242_create_consents_table.php +++ b/database/migrations/2022_04_08_100242_create_consents_table.php @@ -41,7 +41,7 @@ public function up(): void public function down(): void { - Schema::dropIfExists('consents'); Schema::dropIfExists('consent_user'); + Schema::dropIfExists('consents'); } }; diff --git a/database/migrations/2022_04_12_121314_create_banners_table.php b/database/migrations/2022_04_12_121314_create_banners_table.php index f1d335f22..bc80c7dfd 100755 --- a/database/migrations/2022_04_12_121314_create_banners_table.php +++ b/database/migrations/2022_04_12_121314_create_banners_table.php @@ -80,8 +80,8 @@ public function down(): void ->delete(); } - Schema::dropIfExists('banners'); - Schema::dropIfExists('responsive_media'); Schema::dropIfExists('media_responsive_media'); + Schema::dropIfExists('responsive_media'); + Schema::dropIfExists('banners'); } }; diff --git a/database/migrations/2022_04_19_060131_add_discounted_prices_to_products.php b/database/migrations/2022_04_19_060131_add_discounted_prices_to_products.php index d5943791c..e8271dc65 100755 --- a/database/migrations/2022_04_19_060131_add_discounted_prices_to_products.php +++ b/database/migrations/2022_04_19_060131_add_discounted_prices_to_products.php @@ -44,5 +44,7 @@ public function down(): void $table->dropColumn('price_min_initial'); $table->dropColumn('price_max_initial'); }); + + Schema::dropIfExists('product_sales'); } }; diff --git a/database/migrations/2022_04_22_062331_add_columns_to_payment_methods_table.php b/database/migrations/2022_04_22_062331_add_columns_to_payment_methods_table.php index 6689549e9..046932b4f 100644 --- a/database/migrations/2022_04_22_062331_add_columns_to_payment_methods_table.php +++ b/database/migrations/2022_04_22_062331_add_columns_to_payment_methods_table.php @@ -38,7 +38,7 @@ public function down(): void ->firstOrFail() ->revokePermissionTo('payment_methods.show_details'); - Permission::delete(); + Permission::findByName('payment_methods.show_details')->delete(); Schema::table('payment_methods', function (Blueprint $table): void { $table->dropColumn('icon'); diff --git a/database/migrations/2022_04_25_061637_add_columns_to_payments_table.php b/database/migrations/2022_04_25_061637_add_columns_to_payments_table.php index dc05c26d8..9e3d699d7 100644 --- a/database/migrations/2022_04_25_061637_add_columns_to_payments_table.php +++ b/database/migrations/2022_04_25_061637_add_columns_to_payments_table.php @@ -47,6 +47,7 @@ public function down(): void Permission::findByName('payments.show_details')->delete(); Schema::table('payments', function (Blueprint $table): void { + $table->dropForeign('payments_method_id_foreign'); $table->dropColumn('status'); $table->dropColumn('method_id'); }); diff --git a/database/migrations/2022_05_05_120818_add_base_price_to_order_products.php b/database/migrations/2022_05_05_120818_add_base_price_to_order_products.php index 9122f78b8..35472e2d0 100644 --- a/database/migrations/2022_05_05_120818_add_base_price_to_order_products.php +++ b/database/migrations/2022_05_05_120818_add_base_price_to_order_products.php @@ -27,8 +27,8 @@ function (OrderProduct $product): void { 'price' => $product->price + $schemaPrice, 'price_initial' => $product->price_initial + $schemaPrice, ]); - } - ) + }, + ), ); } @@ -40,8 +40,8 @@ public function down(): void fn (OrderProduct $product) => $product->update([ 'price' => $product->base_price, 'price_initial' => $product->base_price_initial, - ]) - ) + ]), + ), ); Schema::table('order_products', function (Blueprint $table): void { diff --git a/database/migrations/2022_06_03_105713_add_has_schemas_column_to_products_table.php b/database/migrations/2022_06_03_105713_add_has_schemas_column_to_products_table.php index 0741f44a1..2c56e3ee0 100644 --- a/database/migrations/2022_06_03_105713_add_has_schemas_column_to_products_table.php +++ b/database/migrations/2022_06_03_105713_add_has_schemas_column_to_products_table.php @@ -20,7 +20,7 @@ public function up(): void */ public function down(): void { - Schema::table('product_set_product', function (Blueprint $table): void { + Schema::table('products', function (Blueprint $table): void { $table->dropColumn('has_schemas'); }); } diff --git a/database/migrations/2022_10_25_081008_create_product_set_favourites_table.php b/database/migrations/2022_10_25_081008_create_product_set_favourites_table.php index 0cb3c8d16..b42c21651 100644 --- a/database/migrations/2022_10_25_081008_create_product_set_favourites_table.php +++ b/database/migrations/2022_10_25_081008_create_product_set_favourites_table.php @@ -37,7 +37,7 @@ public function up(): void */ public function down(): void { - Schema::dropIfExists('favourite_product_set'); + Schema::dropIfExists('favourite_product_sets'); $authenticated = Role::where('type', '=', RoleType::AUTHENTICATED)->firstOrFail(); $authenticated->revokePermissionTo('profile.favourites_manage'); diff --git a/database/migrations/2023_09_05_124157_add_full_text_index_to_products_table.php b/database/migrations/2023_09_05_124157_add_full_text_index_to_products_table.php new file mode 100644 index 000000000..01ea6ff73 --- /dev/null +++ b/database/migrations/2023_09_05_124157_add_full_text_index_to_products_table.php @@ -0,0 +1,23 @@ +text('search_values')->nullable(); + $table->fullText('search_values'); + }); + } + + public function down(): void + { + Schema::table('products', function (Blueprint $table): void { + $table->dropFullText('products_search_values_fulltext'); + $table->dropColumn('search_values'); + }); + } +}; diff --git a/database/migrations/2023_09_14_131322_redirect_show_permission_for_everyone.php b/database/migrations/2023_09_14_131322_redirect_show_permission_for_everyone.php new file mode 100644 index 000000000..98761c9ab --- /dev/null +++ b/database/migrations/2023_09_14_131322_redirect_show_permission_for_everyone.php @@ -0,0 +1,35 @@ +whereNot('type', RoleType::OWNER) + ->each(function (Role $role): void { + $role->givePermissionTo([ + 'redirects.show', + ]); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Role::query() + ->whereNot('type', RoleType::OWNER) + ->each(function (Role $role): void { + $role->revokePermissionTo([ + 'redirects.show', + ]); + }); + } +}; diff --git a/database/migrations/2023_09_19_195946_update_products_indexes.php b/database/migrations/2023_09_19_195946_update_products_indexes.php new file mode 100644 index 000000000..6e6ab949c --- /dev/null +++ b/database/migrations/2023_09_19_195946_update_products_indexes.php @@ -0,0 +1,26 @@ +dropFullText('products_search_values_fulltext'); + $table->fullText( + ['search_values', 'slug', 'name', 'description_short', 'description_html'], + 'products_fulltext', + ); + }); + } + + public function down(): void + { + Schema::table('products', function (Blueprint $table): void { + $table->dropFullText('products_fulltext'); + $table->fullText('search_values'); + }); + } +}; diff --git a/database/seeders/DiscountSeeder.php b/database/seeders/DiscountSeeder.php index df0026502..95d7d6f82 100755 --- a/database/seeders/DiscountSeeder.php +++ b/database/seeders/DiscountSeeder.php @@ -34,7 +34,7 @@ public function run(): void [ DiscountTargetType::ORDER_VALUE, DiscountTargetType::SHIPPING_PRICE, - ] + ], ) ->random(); diff --git a/database/seeders/OrderSeeder.php b/database/seeders/OrderSeeder.php index f728866ea..32379339b 100755 --- a/database/seeders/OrderSeeder.php +++ b/database/seeders/OrderSeeder.php @@ -87,7 +87,7 @@ function ($order) use ($shipping_methods, $statuses, $orderService, $digital_met for ($i = 0; $i < mt_rand(0, 5); ++$i) { $order->payments()->save(Payment::factory()->make()); } - } + }, ); } @@ -99,7 +99,7 @@ private function addProductsToOrder(Order $order, bool $digital): void fn ($sequence) => [ 'product_id' => Product::where('shipping_digital', $digital)->inRandomOrder()->first()->getKey(), 'shipping_digital' => $digital, - ] + ], ) ->make(); $order->products()->saveMany($products); diff --git a/database/seeders/ProductSeeder.php b/database/seeders/ProductSeeder.php index b364d3e96..1cc17934f 100755 --- a/database/seeders/ProductSeeder.php +++ b/database/seeders/ProductSeeder.php @@ -24,65 +24,63 @@ class ProductSeeder extends Seeder */ public function run(): void { - Product::withoutSyncingToSearch(function (): void { - /** @var ProductServiceContract $productService */ - $productService = App::make(ProductServiceContract::class); - - $products = Product::factory()->count(100) - ->state(fn ($sequence) => [ - 'shipping_digital' => mt_rand(0, 1), - ]) - ->create(); - - $sets = ProductSet::all(); - - $brands = ProductSet::factory([ - 'name' => 'Brands', - 'slug' => 'brands', - ])->make(); - $this->seo($brands); - $brands = ProductSet::factory([ - 'parent_id' => $brands->getKey(), - ])->count(4)->create(); - - $brands->each(fn ($set) => $this->seo($set)); - - $categories = ProductSet::factory([ - 'name' => 'Categories', - 'slug' => 'categories', - ])->create(); - $this->seo($categories); - $categories = ProductSet::factory([ - 'parent_id' => $categories->getKey(), - ])->count(4)->create(); - - $categories->each(fn ($set) => $this->seo($set)); - - $products->each(function ($product, $index) use ($sets, $brands, $categories, $productService): void { - if (mt_rand(0, 1)) { - $this->schemas($product); - } - - $this->media($product); - $this->sets($product, $sets); - $this->seo($product); - - if ($index >= 75) { - $this->brands($product, $brands); - } elseif ($index >= 50) { - $this->categories($product, $categories); - } elseif ($index >= 25) { - $this->brands($product, $brands); - $this->categories($product, $categories); - } - - $product->refresh(); - $product->save(); - $productService->updateMinMaxPrices($product); - }); - - $this->setAvailability(); + /** @var ProductServiceContract $productService */ + $productService = App::make(ProductServiceContract::class); + + $products = Product::factory()->count(100) + ->state(fn ($sequence) => [ + 'shipping_digital' => mt_rand(0, 1), + ]) + ->create(); + + $sets = ProductSet::all(); + + $brands = ProductSet::factory([ + 'name' => 'Brands', + 'slug' => 'brands', + ])->make(); + $this->seo($brands); + $brands = ProductSet::factory([ + 'parent_id' => $brands->getKey(), + ])->count(4)->create(); + + $brands->each(fn ($set) => $this->seo($set)); + + $categories = ProductSet::factory([ + 'name' => 'Categories', + 'slug' => 'categories', + ])->create(); + $this->seo($categories); + $categories = ProductSet::factory([ + 'parent_id' => $categories->getKey(), + ])->count(4)->create(); + + $categories->each(fn ($set) => $this->seo($set)); + + $products->each(function ($product, $index) use ($sets, $brands, $categories, $productService): void { + if (mt_rand(0, 1)) { + $this->schemas($product); + } + + $this->media($product); + $this->sets($product, $sets); + $this->seo($product); + + if ($index >= 75) { + $this->brands($product, $brands); + } elseif ($index >= 50) { + $this->categories($product, $categories); + } elseif ($index >= 25) { + $this->brands($product, $brands); + $this->categories($product, $categories); + } + + $product->refresh(); + $product->save(); + $productService->updateMinMaxPrices($product); }); + + $this->setAvailability(); } private function seo(Product|ProductSet $product): void diff --git a/docker-compose.yaml b/docker-compose.yaml index cf888548a..5d2f8ceff 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -22,7 +22,6 @@ services: exec apache2-foreground depends_on: - mysql_service - - elasticsearch queue: build: context: ./docker @@ -48,7 +47,7 @@ services: - mysql_service - redis mysql_service: - image: mysql:8.0 + image: mysql:8 restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: ${DB_PASSWORD} @@ -65,21 +64,6 @@ services: restart: unless-stopped ports: - ${REDIS_PORT:-6379}:6379 - elasticsearch: - build: - context: ./docker - dockerfile: Dockerfile-elastic - ports: - - ${ELASTICSEARCH_PORT:-9200}:9200 - environment: - - xpack.security.enabled=false - - discovery.type=single-node - kibana: - image: docker.elastic.co/kibana/kibana:8.1.0 - environment: - - ELASTICSEARCH_HOSTS=http://elasticsearch:${ELASTICSEARCH_PORT:-9200} - depends_on: - - elasticsearch nginx: image: nginx restart: unless-stopped @@ -89,11 +73,9 @@ services: - ${DOCKER_PORT:-80}:80 environment: - ADMINER_PREFIX=${DOCKER_ADMINER_PREFIX:-adminer} - - KIBANA_PREFIX=${DOCKER_KIBANA_PREFIX:-kibana} - SILVERBOX_PREFIX=${DOCKER_SILVERBOX_PREFIX:-silverbox} depends_on: - app - - kibana silverbox: image: heseya/silverbox:1.2.0 restart: unless-stopped diff --git a/docker/Dockerfile-elastic b/docker/Dockerfile-elastic deleted file mode 100644 index 3e950888a..000000000 --- a/docker/Dockerfile-elastic +++ /dev/null @@ -1,3 +0,0 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:8.1.0 - -RUN bin/elasticsearch-plugin install pl.allegro.tech.elasticsearch.plugin:elasticsearch-analysis-morfologik:8.1.0 diff --git a/docker/nginx/default.conf.template b/docker/nginx/default.conf.template index da1c93d0c..785e6a2b4 100644 --- a/docker/nginx/default.conf.template +++ b/docker/nginx/default.conf.template @@ -37,16 +37,3 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } - - -server { - listen 80; - server_name ${KIBANA_PREFIX}.*; - - location / { - proxy_pass http://kibana:5601; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } -} diff --git a/pint.json b/pint.json index b7b029c27..20fa157ef 100644 --- a/pint.json +++ b/pint.json @@ -45,6 +45,31 @@ "phpdoc_var_annotation_correct_order": true, "simplified_if_return": true, "use_arrow_functions": true, + "normalize_index_brace": true, + "no_multiline_whitespace_around_double_arrow": true, + "control_structure_braces": true, + "statement_indentation": true, + "indentation_type": true, + "no_whitespace_before_comma_in_array": { + "after_heredoc": true + }, + "no_trailing_comma_in_singleline": { + "elements": [ + "arguments", + "array", + "array_destructuring", + "group_import" + ] + }, + "trailing_comma_in_multiline": { + "after_heredoc": true, + "elements": [ + "arguments", + "arrays", + "match", + "parameters" + ] + }, "phpdoc_line_span": { "const": "single", "method": "multi", diff --git a/public/index.php b/public/index.php index aa17e3ba0..1294666ad 100644 --- a/public/index.php +++ b/public/index.php @@ -61,7 +61,7 @@ $kernel = $app->make(Kernel::class); $response = tap($kernel->handle( - $request = Request::capture() + $request = Request::capture(), ))->send(); $kernel->terminate($request, $response); diff --git a/routes/attribute.php b/routes/attribute.php index dfb136b53..a71f6aa79 100644 --- a/routes/attribute.php +++ b/routes/attribute.php @@ -36,6 +36,6 @@ ->middleware('can:attributes.edit'); Route::patch( 'id:{attribute:id}/options/id:{option:id}/metadata-private', - [MetadataController::class, 'updateOrCreate'] + [MetadataController::class, 'updateOrCreate'], )->middleware('can:attributes.edit'); }); diff --git a/src/Domain/Redirect/Controllers/RedirectController.php b/src/Domain/Redirect/Controllers/RedirectController.php index 2ed08a0c4..e3c138392 100644 --- a/src/Domain/Redirect/Controllers/RedirectController.php +++ b/src/Domain/Redirect/Controllers/RedirectController.php @@ -25,7 +25,7 @@ public function index(RedirectIndexDto $dto): JsonResource public function store(RedirectCreateDto $dto): JsonResource { return RedirectResource::make( - $this->redirectService->create($dto) + $this->redirectService->create($dto), ); } @@ -37,7 +37,7 @@ public function show(Redirect $redirect): JsonResource public function update(Redirect $redirect, RedirectUpdateDto $dto): JsonResource { return RedirectResource::make( - $this->redirectService->update($redirect, $dto) + $this->redirectService->update($redirect, $dto), ); } diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index d09614712..b3365feb7 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -19,7 +19,6 @@ trait CreatesApplication 'view:clear', 'config:clear', 'route:clear', - 'scout:index products', ]; /** diff --git a/tests/Feature/Attributes/AttributeTest.php b/tests/Feature/Attributes/AttributeTest.php index 9cf2d8b8b..335846124 100644 --- a/tests/Feature/Attributes/AttributeTest.php +++ b/tests/Feature/Attributes/AttributeTest.php @@ -144,7 +144,7 @@ public function testIndexMetadata(string $user): void ->assertOk() ->assertJsonCount(1, 'data') ->assertJsonFragment( - array_merge($this->newAttribute, ['Dystrybucja' => 'Polska']) + array_merge($this->newAttribute, ['Dystrybucja' => 'Polska']), ); } @@ -195,7 +195,7 @@ public function testIndexMetadataPrivate(string $user): void ->assertOk() ->assertJsonCount(1, 'data') ->assertJsonFragment( - array_merge($this->newAttribute, ['Dystrybucja' => 'Polska']) + array_merge($this->newAttribute, ['Dystrybucja' => 'Polska']), ); } @@ -873,7 +873,7 @@ public function testIndexOptionsMetadata(string $user): void [ 'index' => 1, 'attribute_id' => $this->attribute->getKey(), - ] + ], ); $option->metadata()->create([ 'name' => 'Dystrybucja', @@ -888,7 +888,7 @@ public function testIndexOptionsMetadata(string $user): void ->assertOk() ->assertJsonCount(1, 'data') ->assertJsonFragment( - array_merge($this->newOption, ['Dystrybucja' => 'Polska']) + array_merge($this->newOption, ['Dystrybucja' => 'Polska']), ); } @@ -904,7 +904,7 @@ public function testIndexOptionsMetadataNotFound(string $user): void [ 'index' => 1, 'attribute_id' => $this->attribute->getKey(), - ] + ], ); $option->metadata()->create([ 'name' => 'Dystrybucja', @@ -932,7 +932,7 @@ public function testIndexOptionsMetadataPrivate(string $user): void [ 'index' => 1, 'attribute_id' => $this->attribute->getKey(), - ] + ], ); $option->metadata()->create([ 'name' => 'Dystrybucja', @@ -947,7 +947,7 @@ public function testIndexOptionsMetadataPrivate(string $user): void ->assertOk() ->assertJsonCount(1, 'data') ->assertJsonFragment( - array_merge($this->newOption, ['Dystrybucja' => 'Polska']) + array_merge($this->newOption, ['Dystrybucja' => 'Polska']), ); } @@ -963,7 +963,7 @@ public function testIndexOptionsMetadataPrivateNotFound(string $user): void [ 'index' => 1, 'attribute_id' => $this->attribute->getKey(), - ] + ], ); $option->metadata()->create([ 'name' => 'Dystrybucja', @@ -1127,7 +1127,7 @@ public function testUpdateOption(string $user): void ->json( 'PATCH', '/attributes/id:' . $this->attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertOk() ->assertJsonFragment($optionUpdate); @@ -1152,7 +1152,7 @@ public function testUpdateOptionWithoutId(string $user): void ->json( 'PATCH', '/attributes/id:' . $this->attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertOk() ->assertJsonFragment($optionUpdate); @@ -1185,7 +1185,7 @@ public function testUpdateOptionIncompleteData(string $user): void ->json( 'PATCH', '/attributes/id:' . $attribute->getKey() . '/options/id:' . $option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertUnprocessable(); } @@ -1212,7 +1212,7 @@ public function testUpdateOptionNotExisting(string $user): void ->json( 'PATCH', '/attributes/id:' . $this->attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertNotFound(); } @@ -1239,7 +1239,7 @@ public function testUpdateOptionNotRelatedOption(string $user): void ->json( 'PATCH', '/attributes/id:' . $attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertNotFound(); } @@ -1261,7 +1261,7 @@ public function testUpdateOptionUnauthorized(string $user): void ->actingAs($this->{$user}) ->patchJson( '/attributes/id:' . $this->attribute->getKey() . '/options/id:' . $this->option->getKey(), - $optionUpdate + $optionUpdate, ) ->assertForbidden(); } diff --git a/tests/Feature/AuthTest.php b/tests/Feature/AuthTest.php index 528b63a3a..9a4f71b04 100644 --- a/tests/Feature/AuthTest.php +++ b/tests/Feature/AuthTest.php @@ -317,7 +317,7 @@ function ($job) use ($webHook, $userFailed, $attemptFailed) { && $payload['data_type'] === 'LocalizedLoginAttempt' && $payload['event'] === 'NewLocalizationLoginAttempt' && $payload['issuer_type'] === IssuerType::USER; - } + }, ); } @@ -821,7 +821,7 @@ public function testLogoutWithInvalidatedTokenAfterRefreshToken(): void [ 'refresh_token' => $refreshToken, ], - $this->defaultHeaders + ['Authorization' => 'Bearer ' . $token] + $this->defaultHeaders + ['Authorization' => 'Bearer ' . $token], ); $this @@ -829,7 +829,7 @@ public function testLogoutWithInvalidatedTokenAfterRefreshToken(): void 'POST', '/auth/logout', [], - $this->defaultHeaders + ['Authorization' => 'Bearer ' . $token] + $this->defaultHeaders + ['Authorization' => 'Bearer ' . $token], ) ->assertStatus(422); } @@ -1686,7 +1686,7 @@ public function testConfirmAppTfa(): void Notification::assertSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); $this->assertDatabaseHas('users', [ @@ -1748,7 +1748,7 @@ public function testConfirmAppTfaNoPreferences(): void Notification::assertNotSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); Event::assertNotDispatched(TfaRecoveryCodesChanged::class); @@ -1770,7 +1770,7 @@ public function testSetupEmailTfa(): void Notification::assertSentTo( [$this->user], - TFAInitialization::class + TFAInitialization::class, ); $this->assertDatabaseHas('users', [ @@ -1871,7 +1871,7 @@ public function testConfirmEmailTfa(): void Notification::assertSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); $this->assertDatabaseHas('users', [ @@ -1929,7 +1929,7 @@ public function testConfirmEmailTfaNoPreferences(): void Notification::assertNotSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); Event::assertNotDispatched(TfaRecoveryCodesChanged::class); @@ -1992,7 +1992,7 @@ public function testRecoveryCodesCreate($method, $secret): void Notification::assertSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); $recovery_codes = OneTimeSecurityCode::where('user_id', '=', $this->user->getKey()) @@ -2027,7 +2027,7 @@ public function testRecoveryCodesCreateNoPreferences($method, $secret): void Notification::assertNotSentTo( [$this->user], - TFARecoveryCodes::class + TFARecoveryCodes::class, ); Event::assertNotDispatched(TfaRecoveryCodesChanged::class); diff --git a/tests/Feature/BannerTest.php b/tests/Feature/BannerTest.php index f9a7e003a..fe606b372 100644 --- a/tests/Feature/BannerTest.php +++ b/tests/Feature/BannerTest.php @@ -309,7 +309,7 @@ public function testCreateBannerWithMetadata($user): void 'metadata' => [ 'attributeMeta' => 'attributeValue', ], - ] + ], ) ->assertCreated() ->assertJsonFragment($this->newBanner) @@ -337,7 +337,7 @@ public function testCreateBannerWithMetadataPrivate($user): void 'metadata_private' => [ 'attributeMetaPriv' => 'attributeValue', ], - ] + ], ) ->assertCreated() ->assertJsonFragment($this->newBanner) @@ -416,7 +416,7 @@ public function testUpdateBanner($user): void ->actingAs($this->{$user}) ->patchJson( "/banners/id:{$this->banner->getKey()}", - $banner + ['banner_media' => [$bannerMedia + $medias]] + $banner + ['banner_media' => [$bannerMedia + $medias]], ) ->assertOk() ->assertJsonFragment($banner); diff --git a/tests/Feature/CartTest.php b/tests/Feature/CartTest.php index b082be72f..90afda4a5 100644 --- a/tests/Feature/CartTest.php +++ b/tests/Feature/CartTest.php @@ -779,7 +779,7 @@ public function testCartProcessCheapestProduct($user, $coupon): void 'schemas' => [], ], ], - ] + $coupons + ] + $coupons, ); $result = $coupon ? ['sales' => []] : ['coupons' => []]; @@ -869,7 +869,7 @@ public function testCartProcessCheapestProductWithSamePrice($user, $coupon): voi 'schemas' => [], ], ], - ] + $coupons + ] + $coupons, ); $result = $coupon ? ['sales' => []] : ['coupons' => []]; @@ -1734,7 +1734,7 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'type' => DiscountType::PERCENTAGE, 'target_type' => DiscountTargetType::PRODUCTS, 'target_is_allow_list' => true, - ] + $code + ] + $code, ); $discountApplied->productSets()->attach($parentSet); @@ -1747,7 +1747,7 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'type' => DiscountType::PERCENTAGE, 'target_type' => DiscountTargetType::PRODUCTS, 'target_is_allow_list' => false, - ] + $code + ] + $code, ); $discount->productSets()->attach($parentSet); @@ -1771,7 +1771,7 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'schemas' => [], ], ], - ] + $coupons + ] + $coupons, ); $result = $coupon ? ['sales' => []] : ['coupons' => []]; @@ -1787,7 +1787,7 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'shipping_price_initial' => 0, 'shipping_price' => 0, 'summary' => 4140, - ] + $result + ] + $result, ) ->assertJsonFragment([ 'cartitem_id' => '1', @@ -1799,14 +1799,14 @@ public function testCartProcessProductInChildrenSet($user, $coupon): void 'id' => $discountApplied->getKey(), 'name' => $discountApplied->name, 'value' => 460, - ] + $discountCode1 + ] + $discountCode1, ) ->assertJsonMissing( [ 'id' => $discount->getKey(), 'name' => $discount->name, 'value' => 0, - ] + $discountCode2 + ] + $discountCode2, ); } @@ -1877,14 +1877,14 @@ public function testCartProcessSaleWithTargetProduct($user): void 'id' => $sale->getKey(), 'name' => $sale->name, 'value' => 0, - ] + ], ) ->assertJsonMissing( [ 'id' => $saleShippingMethod->getKey(), 'name' => $saleShippingMethod->name, 'value' => 0, - ] + ], ); } @@ -1906,7 +1906,7 @@ public function testCartProcessInactive($user, $coupon): void 'target_type' => DiscountTargetType::ORDER_VALUE, 'target_is_allow_list' => true, 'active' => false, - ] + $code + ] + $code, ); $conditionGroup = ConditionGroup::create(); @@ -1938,7 +1938,7 @@ public function testCartProcessInactive($user, $coupon): void 'schemas' => [], ], ], - ] + $coupons + ] + $coupons, ); $result = $coupon ? ['sales' => []] : ['coupons' => []]; @@ -1953,7 +1953,7 @@ public function testCartProcessInactive($user, $coupon): void 'shipping_price_initial' => 0, 'shipping_price' => 0, 'summary' => 9200, - ] + $result + ] + $result, ) ->assertJsonFragment([ 'cartitem_id' => '1', @@ -1965,7 +1965,7 @@ public function testCartProcessInactive($user, $coupon): void 'id' => $discount->getKey(), 'name' => $discount->name, 'value' => 920, - ] + $discountCode + ] + $discountCode, ); } diff --git a/tests/Feature/CategoryTest.php b/tests/Feature/CategoryTest.php index 30963f0fa..c83a31e7c 100644 --- a/tests/Feature/CategoryTest.php +++ b/tests/Feature/CategoryTest.php @@ -29,7 +29,7 @@ public function testGoogleCategory($user): void 4992 - Animals & Pet Supplies > Pet Supplies > Bird Supplies > Bird Toys 4993 - Animals & Pet Supplies > Pet Supplies > Bird Supplies > Bird Treats 4 - Animals & Pet Supplies > Pet Supplies > Cat Supplies -' +', ), ]); $this->actingAs($this->{$user})->json('get', '/google-categories/en-US') diff --git a/tests/Feature/DepositsTest.php b/tests/Feature/DepositsTest.php index 56f9de4b3..66bbca050 100644 --- a/tests/Feature/DepositsTest.php +++ b/tests/Feature/DepositsTest.php @@ -633,22 +633,22 @@ public function testUpdateItemWithShippingTimeAndDateAndCountQuantityNeed(): voi $testCountTimeDate5 = $depositService->getShippingTimeDateForQuantity($item, 11); $this->assertEquals( ['shipping_time' => null, 'shipping_date' => $deposit2->shipping_date], - $testCountTimeDate5 + $testCountTimeDate5, ); $testCountTimeDate6 = $depositService->getShippingTimeDateForQuantity($item, 12); $this->assertEquals( ['shipping_time' => null, 'shipping_date' => $deposit1->shipping_date], - $testCountTimeDate6 + $testCountTimeDate6, ); $testCountTimeDate7 = $depositService->getShippingTimeDateForQuantity($item, 14); $this->assertEquals( ['shipping_time' => null, 'shipping_date' => $deposit3->shipping_date], - $testCountTimeDate7 + $testCountTimeDate7, ); $testCountTimeDate8 = $depositService->getShippingTimeDateForQuantity($item, 20); $this->assertEquals( ['shipping_time' => null, 'shipping_date' => $item->unlimited_stock_shipping_date], - $testCountTimeDate8 + $testCountTimeDate8, ); $item->update(['unlimited_stock_shipping_date' => null]); diff --git a/tests/Feature/Discounts/DiscountSearchTest.php b/tests/Feature/Discounts/DiscountSearchTest.php index f81c17e9b..e4203bb11 100644 --- a/tests/Feature/Discounts/DiscountSearchTest.php +++ b/tests/Feature/Discounts/DiscountSearchTest.php @@ -79,7 +79,7 @@ public function testIndexSearchByIds($kind): void 'ids' => [ $discount2->getKey(), ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') diff --git a/tests/Feature/Discounts/DiscountTest.php b/tests/Feature/Discounts/DiscountTest.php index e90a74161..f960e7eed 100644 --- a/tests/Feature/Discounts/DiscountTest.php +++ b/tests/Feature/Discounts/DiscountTest.php @@ -1230,7 +1230,7 @@ public function testCreateFull($user, $discountKind): void ConditionType::USER_IN, ConditionType::PRODUCT_IN, ConditionType::PRODUCT_IN_SET, - ] + ], ) ) { $response->assertJsonFragment($condition); @@ -1774,7 +1774,7 @@ public function testUpdateFull($user, $discountKind): void [ 'type' => ConditionType::MAX_USES, 'value' => ['max_uses' => 1000], - ] + ], ); $discount->conditionGroups()->attach($conditionGroup); @@ -1822,7 +1822,7 @@ public function testUpdateFull($user, $discountKind): void ConditionType::USER_IN, ConditionType::PRODUCT_IN, ConditionType::PRODUCT_IN_SET, - ] + ], ) ) { $response->assertJsonFragment($condition); diff --git a/tests/Feature/FilterTest.php b/tests/Feature/FilterTest.php index e6f5aac36..4c2dc3a2a 100644 --- a/tests/Feature/FilterTest.php +++ b/tests/Feature/FilterTest.php @@ -101,4 +101,50 @@ public function testFilterWithSetsIds($user): void 'name' => 'Not in query single option', ]); } + + /** + * @dataProvider authProvider + */ + public function testFiltersAndAttributesSameOrder($user): void + { + $this->{$user}->givePermissionTo('attributes.show'); + + $productSet = ProductSet::factory()->create(); + $productSet->attributes()->attach([ + $attr1 = Attribute::factory()->create([ + 'name' => 'Test A', + 'global' => 0, + 'order' => 1, + 'type' => 'number', + ])->getKey(), + $attr2 = Attribute::factory()->create([ + 'global' => 0, + 'name' => 'Test B', + 'order' => 2, + 'type' => 'date', + ])->getKey(), + $attr3 = Attribute::factory()->create([ + 'global' => 0, + 'order' => 0, + 'name' => 'Test C', + 'type' => 'date', + ])->getKey(), + ]); + + $this + ->actingAs($this->{$user}) + ->getJson('/attributes') + ->assertJsonPath('data.0.id', $attr3) + ->assertJsonPath('data.1.id', $attr1) + ->assertJsonPath('data.2.id', $attr2); + + $this + ->actingAs($this->{$user}) + ->json('GET', '/filters', [ + 'sets' => [$productSet->getKey()], + ]) + ->assertJsonPath('data.0.id', $attr3) + ->assertJsonPath('data.1.id', $attr1) + ->assertJsonPath('data.2.id', $attr2); + } } diff --git a/tests/Feature/Media/MediaTest.php b/tests/Feature/Media/MediaTest.php index 5319adf62..363261fdf 100644 --- a/tests/Feature/Media/MediaTest.php +++ b/tests/Feature/Media/MediaTest.php @@ -18,6 +18,46 @@ class MediaTest extends TestCase { private Media $media; + public static function deleteProvider(): array + { + return [ + 'as user pages add permission' => ['user', 'pages.add'], + 'as app pages add permission' => ['application', 'pages.add'], + 'as user pages edit permission' => ['user', 'pages.edit'], + 'as app pages edit permission' => ['application', 'pages.edit'], + 'as user products add permission' => ['user', 'products.add'], + 'as app products add permission' => ['application', 'products.add'], + ]; + } + + public static function videoProvider(): array + { + return [ + 'as user mp4' => ['user', '.mp4', 'video/mp4'], + 'as user webm' => ['user', '.webm', 'video/webm'], + 'as user ogv' => ['user', '.ogv', 'video/ogg'], + 'as user ogg' => ['user', '.ogg', 'video/ogg'], + 'as user mov' => ['user', '.mov', 'video/quicktime'], + 'as user wmv' => ['user', '.wmv', 'video/x-ms-wmv'], + 'as app mp4' => ['application', '.mp4', 'video/mp4'], + 'as app webm' => ['application', '.webm', 'video/webm'], + 'as app ogv' => ['application', '.ogv', 'video/ogg'], + 'as app ogg' => ['application', '.ogg', 'video/ogg'], + 'as app mov' => ['application', '.mov', 'video/quicktime'], + 'as app wmv' => ['application', '.wmv', 'video/x-ms-wmv'], + ]; + } + + public static function invalidVideoProvider(): array + { + return [ + 'as user avi' => ['user', '.avi', 'video/x-msvideo'], + 'as user ogg audio' => ['user', '.ogg', 'audio/ogg'], + 'as app avi' => ['application', '.avi', 'video/x-msvideo'], + 'as app ogg audio' => ['application', '.ogg', 'audio/ogg'], + ]; + } + public function setUp(): void { parent::setUp(); @@ -70,6 +110,38 @@ public function testIndex($user): void ]); } + /** + * @dataProvider authProvider + */ + public function testIndexFewFilters($user): void + { + $this->{$user}->givePermissionTo('media.show'); + + Media::query()->delete(); + + Media::factory()->create([ + 'type' => MediaType::OTHER, + 'alt' => 'Instrukcja', + ]); + + $expected = Media::factory()->create([ + 'type' => MediaType::VIDEO, + 'alt' => 'Instrukcja', + ]); + + Media::factory()->create([ + 'type' => MediaType::PHOTO, + 'alt' => 'test', + ]); + + $response = $this->actingAs($this->{$user})->json('GET', '/media?search=Instrukcja&type=video'); + + $response->assertJsonCount(1, 'data') + ->assertJsonFragment([ + 'id' => $expected->getKey(), + ]); + } + /** * @dataProvider authProvider */ @@ -267,14 +339,15 @@ public function testUpload($user): void 'test' => 'value', ], ]) - ->assertJsonStructure(['data' => [ - 'id', - 'type', - 'url', - 'slug', - 'alt', - 'metadata', - ], + ->assertJsonStructure([ + 'data' => [ + 'id', + 'type', + 'url', + 'slug', + 'alt', + 'metadata', + ], ]); } @@ -349,14 +422,15 @@ public function testUploadPdf($user): void $response ->assertCreated() ->assertJsonFragment(['type' => MediaType::DOCUMENT]) - ->assertJsonStructure(['data' => [ - 'id', - 'type', - 'url', - 'slug', - 'alt', - 'metadata', - ], + ->assertJsonStructure([ + 'data' => [ + 'id', + 'type', + 'url', + 'slug', + 'alt', + 'metadata', + ], ]); } @@ -412,18 +486,6 @@ public function testUploadLegacyPermissionProductsEdit($user): void ])->assertForbidden(); } - public static function deleteProvider(): array - { - return [ - 'as user pages add permission' => ['user', 'pages.add'], - 'as app pages add permission' => ['application', 'pages.add'], - 'as user pages edit permission' => ['user', 'pages.edit'], - 'as app pages edit permission' => ['application', 'pages.edit'], - 'as user products add permission' => ['user', 'products.add'], - 'as app products add permission' => ['application', 'products.add'], - ]; - } - public function testDeleteUnauthorized(): void { $this @@ -507,24 +569,6 @@ public function testDeleteFromProductSilverboxMedia($user): void $this->assertDatabaseMissing('media', ['id' => $media->getKey()]); } - public static function videoProvider(): array - { - return [ - 'as user mp4' => ['user', '.mp4', 'video/mp4'], - 'as user webm' => ['user', '.webm', 'video/webm'], - 'as user ogv' => ['user', '.ogv', 'video/ogg'], - 'as user ogg' => ['user', '.ogg', 'video/ogg'], - 'as user mov' => ['user', '.mov', 'video/quicktime'], - 'as user wmv' => ['user', '.wmv', 'video/x-ms-wmv'], - 'as app mp4' => ['application', '.mp4', 'video/mp4'], - 'as app webm' => ['application', '.webm', 'video/webm'], - 'as app ogv' => ['application', '.ogv', 'video/ogg'], - 'as app ogg' => ['application', '.ogg', 'video/ogg'], - 'as app mov' => ['application', '.mov', 'video/quicktime'], - 'as app wmv' => ['application', '.wmv', 'video/x-ms-wmv'], - ]; - } - /** * @dataProvider videoProvider */ @@ -544,24 +588,15 @@ public function testUploadVideo($user, $extension, $mime): void $response ->assertCreated() ->assertJsonFragment(['type' => MediaType::VIDEO]) - ->assertJsonStructure(['data' => [ - 'id', - 'type', - 'url', - ], + ->assertJsonStructure([ + 'data' => [ + 'id', + 'type', + 'url', + ], ]); } - public static function invalidVideoProvider(): array - { - return [ - 'as user avi' => ['user', '.avi', 'video/x-msvideo'], - 'as user ogg audio' => ['user', '.ogg', 'audio/ogg'], - 'as app avi' => ['application', '.avi', 'video/x-msvideo'], - 'as app ogg audio' => ['application', '.ogg', 'audio/ogg'], - ]; - } - /** * @dataProvider invalidVideoProvider */ diff --git a/tests/Feature/MetadataTest.php b/tests/Feature/MetadataTest.php index c7368c672..773482000 100644 --- a/tests/Feature/MetadataTest.php +++ b/tests/Feature/MetadataTest.php @@ -224,7 +224,7 @@ public function testAddMetadata($user, $data): void $response = $this->actingAs($this->{$user})->patchJson( "/{$data['prefix_url']}/id:{$object->getKey()}/metadata", - $metadata + $metadata, ); $response @@ -262,7 +262,7 @@ public function testAddMetadataPrivate($user, $data): void $this->actingAs($this->{$user})->patchJson( "/{$data['prefix_url']}/id:{$object->getKey()}/metadata-private", - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -301,7 +301,7 @@ public function testUpdateMetadata($user, $data): void "/{$data['prefix_url']}/id:{$object->getKey()}/metadata", [ $metadata->name => 'new super value', - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -339,7 +339,7 @@ public function testUpdateMetadataSameKeys($user): void "/products/id:{$product->getKey()}/metadata", [ $metadata->name => 'new super value', - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -386,7 +386,7 @@ public function testUpdateMetadataPrivate($user, $data): void "/{$data['prefix_url']}/id:{$object->getKey()}/metadata-private", [ $metadata->name => 'new super value', - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -436,7 +436,7 @@ public function testDeleteMetadata($user, $data): void [ $metadata1->name => $metadata1->value, $metadata2->name => null, - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -489,7 +489,7 @@ public function testDeleteMetadataPrivate($user, $data): void [ $metadata1->name => $metadata1->value, $metadata2->name => null, - ] + ], ) ->assertOk() ->assertJsonFragment(['data' => [ @@ -534,7 +534,7 @@ public function testAddMyMetadataPersonal(): void $this->actingAs($this->user)->json( 'PATCH', '/auth/profile/metadata-personal', - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -574,7 +574,7 @@ public function testUpdateMyMetadataPersonal(): void $this->actingAs($this->user)->json( 'PATCH', '/auth/profile/metadata-personal', - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -608,7 +608,7 @@ public function testDeleteMyMetadataPersonal(): void $this->actingAs($this->user)->json( 'PATCH', '/auth/profile/metadata-personal', - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => []]); @@ -639,7 +639,7 @@ public function testAddUserMetadataPersonal($user): void ->json( 'PATCH', "/users/id:{$model->getKey()}/metadata-personal", - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -685,7 +685,7 @@ public function testUpdateUserMetadataPersonal($user): void $this->actingAs($this->{$user})->json( 'PATCH', "/users/id:{$model->getKey()}/metadata-personal", - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => $metadata]); @@ -725,7 +725,7 @@ public function testDeleteUserMetadataPersonal($user): void $this->actingAs($this->{$user})->json( 'PATCH', "/users/id:{$model->getKey()}/metadata-personal", - $metadata + $metadata, ) ->assertOk() ->assertJsonFragment(['data' => []]); diff --git a/tests/Feature/OrderCreateTest.php b/tests/Feature/OrderCreateTest.php index cdcbd8a79..f203ae020 100644 --- a/tests/Feature/OrderCreateTest.php +++ b/tests/Feature/OrderCreateTest.php @@ -1031,7 +1031,7 @@ public function testCantCreateOrderWithoutBillingAddress($user): void 'quantity' => 20, ], ], - ] + ], ) ->assertUnprocessable(); diff --git a/tests/Feature/OrderDocumentTest.php b/tests/Feature/OrderDocumentTest.php index c6ad37bc8..ba5d91d40 100644 --- a/tests/Feature/OrderDocumentTest.php +++ b/tests/Feature/OrderDocumentTest.php @@ -95,7 +95,7 @@ public function testDeleteDocument($user): void 'orders/id:' . $this->order->getKey() . '/docs/id:' - . $this->order->documents()->latest()->first()->pivot->id + . $this->order->documents()->latest()->first()->pivot->id, ); $response->assertStatus(204); @@ -186,7 +186,7 @@ public function testDownloadDocument($user): void 'orders/id:' . $this->order->getKey() . '/docs/id:' . $this->order->documents->last()->pivot->id - . '/download' + . '/download', ); $response @@ -218,7 +218,7 @@ public function testDownloadUserDocumentWithoutPermission($user): void 'orders/id:' . $this->order->getKey() . '/docs/id:' . $this->order->documents->last()->pivot->id - . '/download' + . '/download', ); $response @@ -250,7 +250,7 @@ public function testDownloadDocumentUnauthorized($user): void 'orders/id:' . $this->order->getKey() . '/docs/id:' . $this->order->documents->last()->pivot->id - . '/download' + . '/download', ); $response diff --git a/tests/Feature/OrderProductTest.php b/tests/Feature/OrderProductTest.php index 672302d7b..b987703f5 100644 --- a/tests/Feature/OrderProductTest.php +++ b/tests/Feature/OrderProductTest.php @@ -199,7 +199,7 @@ public function testOrderNotSendUrls($user): void ->actingAs($this->{$user}) ->json( 'POST', - '/orders/id:' . $this->order->getKey() . '/send-urls' + '/orders/id:' . $this->order->getKey() . '/send-urls', )->assertOk(); $this->assertDatabaseHas('order_products', [ @@ -230,7 +230,7 @@ public function testOrderSendUrls($user): void ->actingAs($this->{$user}) ->json( 'POST', - '/orders/id:' . $this->order->getKey() . '/send-urls' + '/orders/id:' . $this->order->getKey() . '/send-urls', )->assertOk(); $this->assertDatabaseHas('order_products', [ diff --git a/tests/Feature/OrderUpdateTest.php b/tests/Feature/OrderUpdateTest.php index 7f8ada018..99e04e76a 100644 --- a/tests/Feature/OrderUpdateTest.php +++ b/tests/Feature/OrderUpdateTest.php @@ -965,7 +965,7 @@ public function testShippingListDispatched($user): void '/orders/id:' . $this->order->getKey() . '/shipping-lists', [ 'package_template_id' => $package->getKey(), - ] + ], )->assertOk() ->assertJsonFragment([ 'id' => $this->order->getKey(), @@ -1009,7 +1009,7 @@ public function testShippingListNotExistingPackageTemplate($user): void '/orders/id:' . $this->order->getKey() . '/shipping-lists', [ 'package_template_id' => $package->getKey(), - ] + ], )->assertUnprocessable(); Event::assertNotDispatched(OrderRequestedShipping::class); @@ -1107,7 +1107,7 @@ public function testUpdateOrderProductUrl($user): void 'first_url' => 'https://example.com', 'second_url' => 'https://example2.com', ], - ] + ], ) ->assertOk(); @@ -1163,7 +1163,7 @@ public function testUpdateOneOrderProductUrl($user): void 'urls' => [ 'updated_url' => 'https://updated.com', ], - ] + ], ) ->assertOk(); @@ -1222,7 +1222,7 @@ public function testUpdateOrderDigitalShippingMethod($user): void "/orders/id:{$order->getKey()}", [ 'digital_shipping_method_id' => $digitalShippingMethodNew->getKey(), - ] + ], ) ->assertOk() ->assertJsonFragment([ @@ -1271,7 +1271,7 @@ public function testUpdateOrderDigital($user): void "/orders/id:{$order->getKey()}", [ 'comment' => 'New comment', - ] + ], ) ->assertOk() ->assertJsonFragment([ @@ -1314,7 +1314,7 @@ public function testDeleteOrderProductUrl($user): void 'old_url' => null, 'second_url' => 'https://example2.com', ], - ] + ], ) ->assertOk(); diff --git a/tests/Feature/PageTest.php b/tests/Feature/PageTest.php index 61b322e0c..dec24b127 100644 --- a/tests/Feature/PageTest.php +++ b/tests/Feature/PageTest.php @@ -720,7 +720,7 @@ public function testUpdateWithSeo($user, $boolean, $booleanValue): void $response = $this->actingAs($this->{$user})->json( 'PATCH', '/pages/id:' . $this->page->getKey(), - $page + $page, ); $response diff --git a/tests/Feature/PerformanceTest.php b/tests/Feature/PerformanceTest.php index 22ccf49ab..7e5750690 100644 --- a/tests/Feature/PerformanceTest.php +++ b/tests/Feature/PerformanceTest.php @@ -503,7 +503,7 @@ public function testViewOrderPerformanceWithDiscounts(): void 'target_type' => $discountOrder->target_type, 'applied_discount' => $order->shipping_price_initial, 'code' => $discountOrder->code, - ] + ], ); $discountProduct = Discount::factory()->create([ diff --git a/tests/Feature/ProductAvailabilityTest.php b/tests/Feature/ProductAvailabilityTest.php index be6ba83ae..f7d24ae18 100644 --- a/tests/Feature/ProductAvailabilityTest.php +++ b/tests/Feature/ProductAvailabilityTest.php @@ -140,7 +140,7 @@ public function testMultipleItemsDeposits($user): void $item3->getKey() => [ 'required_quantity' => 1, // 4 ], - ] + ], ); $this @@ -220,7 +220,7 @@ public function testMultipleItemsSameQuantityDeposits($user): void $item4->getKey() => [ 'required_quantity' => 1, ], - ] + ], ); // After adding this deposit should be: diff --git a/tests/Feature/ProductSearchDatabaseTest.php b/tests/Feature/ProductSearchDatabaseTest.php index e10d69cfd..3ddb0382a 100644 --- a/tests/Feature/ProductSearchDatabaseTest.php +++ b/tests/Feature/ProductSearchDatabaseTest.php @@ -46,25 +46,6 @@ public function testIndex($user): void $this->assertQueryCountLessThan(20); } - /** - * @dataProvider authProvider - */ - public function testSearch($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $product = Product::factory()->create([ - 'public' => true, - ]); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['search' => $product->name]) - ->assertOk() - ->assertJsonCount(1, 'data') - ->assertJsonFragment(['id' => $product->getKey()]); - } - /** * @dataProvider authProvider */ @@ -727,7 +708,7 @@ public function testSearchByAttributeId($user): void 'attribute' => [ $attribute->slug => $options[0]->getKey(), ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -793,7 +774,7 @@ public function testSearchByAttributeMultippleId($user): void $option2->getKey(), ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -858,7 +839,7 @@ public function testSearchByAttributeNumber($user): void 'max' => 2137, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -885,7 +866,7 @@ public function testSearchByAttributeNumber($user): void 'min' => 1337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -912,7 +893,7 @@ public function testSearchByAttributeNumber($user): void 'min' => 2337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -928,7 +909,7 @@ public function testSearchByAttributeNumber($user): void 'max' => 1337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -982,7 +963,7 @@ public function testSearchByAttributeDate($user): void 'max' => '2022-09-30', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -1010,7 +991,7 @@ public function testSearchByAttributeDate($user): void 'max' => '2022-11-30', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -1037,7 +1018,7 @@ public function testSearchByAttributeDate($user): void 'min' => '2022-12-01', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -1053,7 +1034,7 @@ public function testSearchByAttributeDate($user): void 'max' => '2022-09-10', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -1097,7 +1078,7 @@ public function testSearchByAttributeNotId($user): void 'attribute_not' => [ $attribute->slug => $options[0]->getKey(), ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -1157,7 +1138,7 @@ public function testSearchByAttributeNotNumber($user): void 'max' => 2137, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -1179,7 +1160,7 @@ public function testSearchByAttributeNotNumber($user): void 'min' => 1337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -1195,7 +1176,7 @@ public function testSearchByAttributeNotNumber($user): void 'min' => 2337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -1217,7 +1198,7 @@ public function testSearchByAttributeNotNumber($user): void 'max' => 1337, ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -1277,7 +1258,7 @@ public function testSearchByAttributeNotDate($user): void 'max' => '2022-09-30', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(1, 'data') @@ -1300,7 +1281,7 @@ public function testSearchByAttributeNotDate($user): void 'max' => '2022-11-30', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(0, 'data'); @@ -1316,7 +1297,7 @@ public function testSearchByAttributeNotDate($user): void 'min' => '2022-12-01', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') @@ -1338,7 +1319,7 @@ public function testSearchByAttributeNotDate($user): void 'max' => '2022-09-10', ], ], - ] + ], ) ->assertOk() ->assertJsonCount(2, 'data') diff --git a/tests/Feature/ProductSearchElasticTest.php b/tests/Feature/ProductSearchElasticTest.php deleted file mode 100644 index c0c5a343a..000000000 --- a/tests/Feature/ProductSearchElasticTest.php +++ /dev/null @@ -1,2337 +0,0 @@ -app->bind( - ProductRepositoryContract::class, - ProductRepository::class, - ); - } - - /** - * @dataProvider authProvider - */ - public function testIndex($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['limit' => 100]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], 100); - - $this->assertQueryCountLessThan(20); - } - - /** - * @dataProvider authProvider - */ - public function testIndexSortPriceAsc($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['limit' => 100, 'sort' => 'price:asc']) - ->assertOk(); - - $this->assertElasticQuery( - [ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - 100, - [ - 'sort' => [ - [ - 'price_min' => 'asc', - ], - ], - ], - ); - - $this->assertQueryCountLessThan(20); - } - - /** - * @dataProvider authProvider - */ - public function testIndexSortPriceDesc($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['limit' => 100, 'sort' => 'price:desc']) - ->assertOk(); - - $this->assertElasticQuery( - [ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - 100, - [ - 'sort' => [ - [ - 'price_max' => 'desc', - ], - ], - ], - ); - - $this->assertQueryCountLessThan(20); - } - - /** - * @dataProvider authProvider - */ - public function testSearch($user): void - { - $searchQuery = 'search'; - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['search' => $searchQuery]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [ - [ - 'multi_match' => [ - 'query' => $searchQuery, - 'fuzziness' => 'auto', - 'fields' => [ - 'name^10', - 'attributes.*^5', - '*', - ], - ], - ], - ], - 'should' => [], - 'filter' => [ - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testIndexIdsSearch($user): void - { - $uuid1 = '123e4567-e89b-12d3-a456-426655440000'; - $uuid2 = '123e4567-e89b-12d3-a456-426655440001'; - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', [ - 'ids' => [ - $uuid1, - $uuid2, - ], - ]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'id' => [ - $uuid1, - $uuid2, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testIndexHidden($user): void - { - $this->{$user}->givePermissionTo(['products.show', 'products.show_hidden']); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products') - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [], - ], - ]); - } - - /** - * @dataProvider booleanProvider - */ - public function testSearchByPublic($user, $boolean, $booleanValue): void - { - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['public' => $boolean]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'term' => [ - 'public' => [ - 'value' => $booleanValue, - 'boost' => 1.0, - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchBySet($user): void - { - $set = ProductSet::factory()->create([ - 'public' => true, - ]); - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['sets' => [$set->slug]]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'sets_slug' => [ - $set->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchBySetNegation($user): void - { - $set = ProductSet::factory()->create([ - 'public' => true, - ]); - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['sets_not' => [$set->slug]]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'bool' => [ - 'must_not' => [ - 'terms' => [ - 'sets_slug' => [ - $set->slug, - ], - 'boost' => 1.0, - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchBySets($user): void - { - $set = ProductSet::factory()->create([ - 'public' => true, - ]); - - $set2 = ProductSet::factory()->create([ - 'public' => true, - ]); - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', [ - 'sets' => [$set->slug, $set2->slug], - ]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'sets_slug' => [ - $set->slug, - $set2->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchBySetsNegation($user): void - { - $set = ProductSet::factory()->create([ - 'public' => true, - ]); - - $set2 = ProductSet::factory()->create([ - 'public' => true, - ]); - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', [ - 'sets_not' => [$set->slug, $set2->slug], - ]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'bool' => [ - 'must_not' => [ - 'terms' => [ - 'sets_slug' => [ - $set->slug, - $set2->slug, - ], - 'boost' => 1.0, - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchBySetHiddenUnauthorized($user): void - { - $set = ProductSet::factory()->create([ - 'public' => false, - ]); - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['sets' => [$set->slug]]) - ->assertUnprocessable(); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByNonExistingSet($user): void - { - $slug = 'non-existing-set'; - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['sets' => [$slug]]) - ->assertUnprocessable(); - } - - /** - * @dataProvider authProvider - */ - public function testSearchBySetHidden($user): void - { - $set = ProductSet::factory()->create([ - 'public' => true, - ]); - - $this->{$user}->givePermissionTo(['products.show', 'product_sets.show_hidden']); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['sets' => [$set->slug]]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'sets_slug' => [ - $set->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByTag($user): void - { - $uuid = 'a2f4f8b0-f8c9-11e9-9eb6-2a2ae2dbcce4'; - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['tags' => [$uuid]]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'tags_id' => [ - $uuid, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByTagNegation($user): void - { - $uuid = 'a2f4f8b0-f8c9-11e9-9eb6-2a2ae2dbcce4'; - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['tags_not' => [$uuid]]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'bool' => [ - 'must_not' => [ - 'terms' => [ - 'tags_id' => [ - $uuid, - ], - 'boost' => 1.0, - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByTags($user): void - { - $uuid1 = 'a2f4f8b0-f8c9-11e9-9eb6-2a2ae2dbcce4'; - $uuid2 = 'a2f4f8b1-f8c9-11e9-9eb6-2a2ae2dbcce4'; - - $this->{$user}->givePermissionTo('products.show'); - - $this->actingAs($this->{$user}) - ->json('GET', '/products', [ - 'tags' => [ - $uuid1, - $uuid2, - ], - ]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'tags_id' => [ - $uuid1, - $uuid2, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByTagsNegation($user): void - { - $uuid1 = 'a2f4f8b0-f8c9-11e9-9eb6-2a2ae2dbcce4'; - $uuid2 = 'a2f4f8b1-f8c9-11e9-9eb6-2a2ae2dbcce4'; - - $this->{$user}->givePermissionTo('products.show'); - - $this->actingAs($this->{$user}) - ->json('GET', '/products', [ - 'tags_not' => [ - $uuid1, - $uuid2, - ], - ]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'bool' => [ - 'must_not' => [ - 'terms' => [ - 'tags_id' => [ - $uuid1, - $uuid2, - ], - 'boost' => 1.0, - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByMetadata($user): void - { - $erpId = 'a2f4f8b0-f8c9-11e9-9eb6-2a2ae2dbcce4'; - $sku = 123456789; - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', "/products?metadata.erp_id={$erpId}&metadata.sku={$sku}") - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'metadata.name' => [ - 'erp_id', - 'sku', - ], - 'boost' => 1.0, - ], - ], - [ - 'terms' => [ - 'metadata.value' => [ - $erpId, - $sku, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByMetadataClassicArray($user): void - { - $erpId = 'a2f4f8b0-f8c9-11e9-9eb6-2a2ae2dbcce4'; - $sku = 123456789; - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', "/products?metadata[erp_id]={$erpId}&metadata[sku]={$sku}") - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'metadata.name' => [ - 'erp_id', - 'sku', - ], - 'boost' => 1.0, - ], - ], - [ - 'terms' => [ - 'metadata.value' => [ - $erpId, - $sku, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByMetadataBodyParams($user): void - { - $erpId = 'a2f4f8b0-f8c9-11e9-9eb6-2a2ae2dbcce4'; - $sku = 123456789; - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'metadata' => [ - 'erp_id' => $erpId, - 'sku' => $sku, - ], - ], - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'metadata.name' => [ - 'erp_id', - 'sku', - ], - 'boost' => 1.0, - ], - ], - [ - 'terms' => [ - 'metadata.value' => [ - $erpId, - $sku, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByMetadataPrivate($user): void - { - $sku = 123456789; - - $this->{$user}->givePermissionTo(['products.show', 'products.show_metadata_private']); - - $this - ->actingAs($this->{$user}) - ->json('GET', "/products?metadata_private.sku={$sku}") - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'metadata_private.name' => [ - 'sku', - ], - 'boost' => 1.0, - ], - ], - [ - 'terms' => [ - 'metadata_private.value' => [ - $sku, - ], - 'boost' => 1.0, - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByMetadataPrivateUnauthorized($user): void - { - $sku = 123456789; - - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', "/products?metadata_private.sku={$sku}") - ->assertUnprocessable(); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByPrice($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['price' => ['min' => 100, 'max' => 200]]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'range' => [ - 'price_min' => [ - 'gte' => 100.0, - 'boost' => 1.0, - ], - ], - ], - [ - 'range' => [ - 'price_max' => [ - 'lte' => 200.0, - 'boost' => 1.0, - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByPriceZero($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['price' => ['min' => 0]]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'range' => [ - 'price_min' => [ - 'gte' => 0.0, - 'boost' => 1.0, - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeId($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $attribute = Attribute::factory()->create([ - 'name' => 'Serie', - 'slug' => 'serie', - 'sortable' => 1, - 'type' => 'multi-choice-option', - ]); - - $option1 = AttributeOption::factory()->create([ - 'attribute_id' => $attribute->getKey(), - 'index' => 1, - ]); - - $option2 = AttributeOption::factory()->create([ - 'attribute_id' => $attribute->getKey(), - 'index' => 1, - ]); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['attribute' => [$attribute->slug => $option1->getKey()]]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'terms' => [ - 'attributes.values.id' => [ - $option1->getKey(), - ], - 'boost' => 1.0, - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - // Case: Attributes as array - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', [ - 'attribute' => [ - $attribute->slug => [ - $option1->getKey(), - $option2->getKey(), - ], - ], - ]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'terms' => [ - 'attributes.values.id' => [ - $option1->getKey(), - $option2->getKey(), - ], - 'boost' => 1.0, - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - // Case: Attributes as string - coma as delimiter - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', [ - 'attribute' => [ - $attribute->slug => $option1->getKey() . ',' . $option2->getKey(), - ], - ]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'terms' => [ - 'attributes.values.id' => [ - $option1->getKey(), - $option2->getKey(), - ], - 'boost' => 1.0, - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeIdNegation($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $attribute = Attribute::factory()->create([ - 'name' => 'Serie', - 'slug' => 'serie', - 'sortable' => 1, - 'type' => 'multi-choice-option', - ]); - - $option1 = AttributeOption::factory()->create([ - 'attribute_id' => $attribute->getKey(), - 'index' => 1, - ]); - - $option2 = AttributeOption::factory()->create([ - 'attribute_id' => $attribute->getKey(), - 'index' => 1, - ]); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['attribute_not' => [$attribute->slug => $option1->getKey()]]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'bool' => [ - 'must_not' => [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'terms' => [ - 'attributes.values.id' => [ - $option1->getKey(), - ], - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - // Case: Attributes as array - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', [ - 'attribute_not' => [ - $attribute->slug => [ - $option1->getKey(), - $option2->getKey(), - ], - ], - ]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'bool' => [ - 'must_not' => [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'terms' => [ - 'attributes.values.id' => [ - $option1->getKey(), - $option2->getKey(), - ], - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - // Case: Attributes as string - coma as delimiter - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', [ - 'attribute_not' => [ - $attribute->slug => $option1->getKey() . ',' . $option2->getKey(), - ], - ]) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'bool' => [ - 'must_not' => [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'terms' => [ - 'attributes.values.id' => [ - $option1->getKey(), - $option2->getKey(), - ], - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeIdInvalidOption($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $optionId = 'a2f4f8b0-f8c9-11e9-9eb6-2a2ae2dbcce4'; - - $attribute = Attribute::factory()->create([ - 'name' => 'Serie', - 'slug' => 'serie', - 'sortable' => 1, - 'type' => 'multi-choice-option', - ]); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['attribute' => [$attribute->slug => $optionId]]) - ->assertUnprocessable(); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeIdInvalidAttribute($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $slug = 'serie'; - $attribute = Attribute::factory()->create([ - 'sortable' => 1, - ]); - - $option = AttributeOption::factory()->create([ - 'attribute_id' => $attribute->getKey(), - 'index' => 1, - ]); - - $this - ->actingAs($this->{$user}) - ->json('GET', '/products', ['attribute' => [$slug => $option->getKey()]]) - ->assertUnprocessable(); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeNumber($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $attribute = Attribute::factory()->create([ - 'sortable' => 1, - 'type' => 'number', - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute' => [ - $attribute->slug => [ - 'min' => 1337, - 'max' => 2137, - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_number' => [ - 'gte' => 1337, - 'lte' => 2137, - 'boost' => 1.0, - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute' => [ - $attribute->slug => [ - 'min' => 1337, - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_number' => [ - 'gte' => 1337, - 'boost' => 1.0, - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute' => [ - $attribute->slug => [ - 'max' => 2137, - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_number' => [ - 'lte' => 2137, - 'boost' => 1.0, - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeNumberNegation($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $attribute = Attribute::factory()->create([ - 'sortable' => 1, - 'type' => 'number', - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute_not' => [ - $attribute->slug => [ - 'min' => 1337, - 'max' => 2137, - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'bool' => [ - 'must_not' => [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_number' => [ - 'gte' => 1337, - 'lte' => 2137, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute_not' => [ - $attribute->slug => [ - 'min' => 1337, - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'bool' => [ - 'must_not' => [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_number' => [ - 'gte' => 1337, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute_not' => [ - $attribute->slug => [ - 'max' => 2137, - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'bool' => [ - 'must_not' => [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_number' => [ - 'lte' => 2137, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeInvalidNumber($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $attribute = Attribute::factory()->create([ - 'sortable' => 1, - 'type' => 'number', - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute' => [ - $attribute->slug => [ - 'min' => '2022-01-01', - ], - ], - ] - ) - ->assertUnprocessable(); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeDate($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $attribute = Attribute::factory()->create([ - 'sortable' => 1, - 'type' => 'date', - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute' => [ - $attribute->slug => [ - 'min' => '2020-01-01', - 'max' => '2022-01-01', - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_date' => [ - 'gte' => '2020-01-01', - 'lte' => '2022-01-01', - 'boost' => 1.0, - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute' => [ - $attribute->slug => [ - 'min' => '2020-01-01', - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_date' => [ - 'gte' => '2020-01-01', - 'boost' => 1.0, - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute' => [ - $attribute->slug => [ - 'max' => '2022-01-01', - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_date' => [ - 'lte' => '2022-01-01', - 'boost' => 1.0, - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeDateNegation($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $attribute = Attribute::factory()->create([ - 'sortable' => 1, - 'type' => 'date', - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute_not' => [ - $attribute->slug => [ - 'min' => '2020-01-01', - 'max' => '2022-01-01', - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'bool' => [ - 'must_not' => [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_date' => [ - 'gte' => '2020-01-01', - 'lte' => '2022-01-01', - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute_not' => [ - $attribute->slug => [ - 'min' => '2020-01-01', - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'bool' => [ - 'must_not' => [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_date' => [ - 'gte' => '2020-01-01', - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute_not' => [ - $attribute->slug => [ - 'max' => '2022-01-01', - ], - ], - ] - ) - ->assertOk(); - - $this->assertElasticQuery([ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'terms' => [ - 'attributes_slug' => [ - $attribute->slug, - ], - 'boost' => 1.0, - ], - ], - [ - 'bool' => [ - 'must_not' => [ - 'nested' => [ - 'path' => 'attributes.values', - 'query' => [ - 'range' => [ - 'attributes.values.value_date' => [ - 'lte' => '2022-01-01', - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ]); - } - - /** - * @dataProvider authProvider - */ - public function testSearchByAttributeInvalidDate($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $attribute = Attribute::factory()->create([ - 'sortable' => 1, - 'type' => 'date', - ]); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - [ - 'attribute' => [ - $attribute->slug => [ - 'min' => 1337, - ], - ], - ] - ) - ->assertUnprocessable(); - } - - /** - * @dataProvider authProvider - */ - public function testSortBySet($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - ['sort' => 'set.test:desc'], - ) - ->assertOk(); - - $this->assertElasticQuery( - [ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - 24, - [ - 'sort' => [ - [ - 'set.test' => 'desc', - ], - ], - ], - ); - } - - /** - * @dataProvider authProvider - */ - public function testSortByCover($user): void - { - $this->{$user}->givePermissionTo('products.show'); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - ['has_cover' => true], - ) - ->assertOk(); - - $this->assertElasticQuery( - [ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'exists' => [ - 'field' => 'cover', - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - ); - - $this - ->actingAs($this->{$user}) - ->json( - 'GET', - '/products', - ['has_cover' => false], - ) - ->assertOk(); - - $this->assertElasticQuery( - [ - 'bool' => [ - 'must' => [], - 'should' => [], - 'filter' => [ - [ - 'bool' => [ - 'must_not' => [ - 'exists' => [ - 'field' => 'cover', - ], - ], - ], - ], - [ - 'term' => [ - 'public' => [ - 'value' => true, - 'boost' => 1.0, - ], - ], - ], - ], - ], - ], - ); - } -} diff --git a/tests/Feature/ProductSetCreateTest.php b/tests/Feature/ProductSetCreateTest.php index a2e644b04..39d8b1547 100644 --- a/tests/Feature/ProductSetCreateTest.php +++ b/tests/Feature/ProductSetCreateTest.php @@ -174,7 +174,7 @@ public function testCreateTreeViewFalse($user): void 'product_sets', $set + $defaults + [ 'parent_id' => null, - ] + ], ); Event::assertDispatched(ProductSetCreated::class); diff --git a/tests/Feature/ProductSetOtherTest.php b/tests/Feature/ProductSetOtherTest.php index 36b05b63b..d05dca4af 100644 --- a/tests/Feature/ProductSetOtherTest.php +++ b/tests/Feature/ProductSetOtherTest.php @@ -520,7 +520,7 @@ public function testProductReorderInSetHigherOrder($user): void 'order' => 0, ], ], - ] + ], ); $this @@ -564,7 +564,7 @@ public function testProductReorderInSetLowerOrder($user): void 'order' => 4, ], ], - ] + ], ); $this @@ -608,7 +608,7 @@ public function testProductReorderInSetSameOrder($user): void 'order' => 2, ], ], - ] + ], ); $this @@ -652,7 +652,7 @@ public function testProductReorderInSetOrderOutOfSize($user): void 'order' => 9999, ], ], - ] + ], ); $this @@ -706,7 +706,7 @@ public function testProductReorderWhenWasNull($user): void 'order' => 0, ], ], - ] + ], ); $this @@ -758,7 +758,7 @@ public function testProductReorderHandleNulls($user): void 'order' => 0, ], ], - ] + ], ); $this diff --git a/tests/Feature/ProductSetUpdateTest.php b/tests/Feature/ProductSetUpdateTest.php index b41aed8d8..165b2326b 100644 --- a/tests/Feature/ProductSetUpdateTest.php +++ b/tests/Feature/ProductSetUpdateTest.php @@ -132,7 +132,7 @@ public function testUpdateTreeFalse($user): void 'product_sets', $set + $parentId + [ 'slug' => 'test-edit', - ] + ], ); Event::assertDispatched(ProductSetUpdated::class); diff --git a/tests/Feature/ProductTest.php b/tests/Feature/ProductTest.php index c9b9e685f..631428dfb 100644 --- a/tests/Feature/ProductTest.php +++ b/tests/Feature/ProductTest.php @@ -246,11 +246,8 @@ public function testIndex($user): void ->json('GET', '/products', ['limit' => 100]) ->assertOk() ->assertJsonCount(2, 'data') - ->assertJson([ - 'data' => [ - 1 => $this->expected_short, - ], - ])->assertJsonFragment([ + ->assertJsonFragment([ + ...$this->expected_short, 'price_min' => $this->product->price_min, 'price_max' => $this->product->price_max, ]); diff --git a/tests/Feature/Products/ProductSearchValuesTest.php b/tests/Feature/Products/ProductSearchValuesTest.php new file mode 100644 index 000000000..d404ce7d0 --- /dev/null +++ b/tests/Feature/Products/ProductSearchValuesTest.php @@ -0,0 +1,297 @@ +product = Product::factory()->create([ + 'name' => 'Searched product', + 'public' => true, + 'description_html' => 'Lorem ipsum', + 'description_short' => 'short', + ]); + } + + /** + * @dataProvider authProvider + */ + public function testUpdateTagSearchValues(string $user): void + { + $this->{$user}->givePermissionTo('tags.edit'); + + $tag = Tag::factory()->create(); + $this->product->tags()->sync($tag->getKey()); + + $this + ->actingAs($this->{$user}) + ->json('PATCH', 'tags/id:' . $tag->getKey(), [ + 'name' => 'Tag updated', + ]) + ->assertOk(); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => 'Tag updated', + ]); + } + + /** + * @dataProvider authProvider + */ + public function testDeleteTagSearchValues(string $user): void + { + $this->{$user}->givePermissionTo('tags.remove'); + + $tag = Tag::factory()->create(); + $this->product->tags()->sync($tag->getKey()); + + $this + ->actingAs($this->{$user}) + ->json('DELETE', 'tags/id:' . $tag->getKey()) + ->assertNoContent(); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => '', + ]); + } + + /** + * @dataProvider authProvider + */ + public function testUpdateProductSetSearchValues(string $user): void + { + $this->{$user}->givePermissionTo('product_sets.edit'); + + $set = ProductSet::factory()->create([ + 'public' => true, + ]); + $this->product->sets()->sync($set->getKey()); + + $this + ->actingAs($this->{$user}) + ->json('PATCH', 'product-sets/id:' . $set->getKey(), [ + 'name' => 'set name', + 'parent_id' => null, + 'children_ids' => [], + ]) + ->assertOk(); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => 'set name', + ]); + } + + /** + * @dataProvider authProvider + */ + public function testDeleteProductSetSearchValues(string $user): void + { + $this->{$user}->givePermissionTo('product_sets.remove'); + + $set = ProductSet::factory()->create([ + 'public' => true, + ]); + $this->product->sets()->sync($set->getKey()); + + $this + ->actingAs($this->{$user}) + ->json('DELETE', 'product-sets/id:' . $set->getKey()) + ->assertNoContent(); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => '', + ]); + } + + /** + * @dataProvider authProvider + */ + public function testDeleteParentProductSetSearchValues(string $user): void + { + $this->{$user}->givePermissionTo('product_sets.remove'); + + $parent = ProductSet::factory()->create([ + 'name' => 'Parent set', + ]); + + $set = ProductSet::factory()->create([ + 'public' => true, + 'name' => 'children set', + 'parent_id' => $parent->getKey(), + ]); + $this->product->sets()->sync([$parent->getKey(), $set->getKey()]); + + app(ProductServiceContract::class)->updateProductsSearchValues([$this->product->getKey()]); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => 'Parent set children set', + ]); + + $this + ->actingAs($this->{$user}) + ->json('DELETE', 'product-sets/id:' . $set->getKey()) + ->assertNoContent(); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => 'Parent set', + ]); + } + + /** + * @dataProvider authProvider + */ + public function testUpdateAttributeSearchValues(string $user): void + { + $this->{$user}->givePermissionTo('attributes.edit'); + + /** @var Attribute $attribute */ + $attribute = Attribute::factory()->create(); + $this->product->attributes()->attach($attribute->getKey()); + + $this + ->actingAs($this->{$user}) + ->json('PATCH', 'attributes/id:' . $attribute->getKey(), [ + 'name' => 'updated attribute', + 'slug' => $attribute->slug, + 'type' => $attribute->type, + 'global' => true, + 'sortable' => true, + ]) + ->assertOk(); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => 'updated attribute', + ]); + } + + /** + * @dataProvider authProvider + */ + public function testDeleteAttributeSearchValues(string $user): void + { + $this->{$user}->givePermissionTo('attributes.remove'); + + /** @var Attribute $attribute */ + $attribute = Attribute::factory()->create(); + $this->product->attributes()->attach($attribute->getKey()); + + $this + ->actingAs($this->{$user}) + ->json('DELETE', 'attributes/id:' . $attribute->getKey()) + ->assertNoContent(); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => '', + ]); + } + + /** + * @dataProvider authProvider + */ + public function testUpdateAttributeOptionSearchValues(string $user): void + { + $this->{$user}->givePermissionTo('attributes.edit'); + + /** @var Attribute $attribute */ + $attribute = Attribute::factory()->create([ + 'name' => 'Attribute', + 'type' => AttributeType::NUMBER->value, + ]); + + $option = AttributeOption::factory()->create([ + 'index' => 1, + 'attribute_id' => $attribute->getKey(), + ]); + + $this->product->attributes()->attach($attribute->getKey()); + $this->product->attributes->first()->pivot->options()->attach($option->getKey()); + + $this + ->actingAs($this->{$user}) + ->json('PATCH', 'attributes/id:' . $attribute->getKey() . '/options/id:' . $option->getKey(), [ + 'name' => 'option 1', + 'value_number' => 10, + 'value_date' => '2023-09-08', + ]) + ->assertOk(); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => 'Attribute option 1 10 2023-09-08', + ]); + } + + /** + * @dataProvider authProvider + */ + public function testDeleteAttributeOptionSearchValues(string $user): void + { + $this->{$user}->givePermissionTo('attributes.edit'); + + /** @var Attribute $attribute */ + $attribute = Attribute::factory()->create([ + 'name' => 'Attribute', + 'type' => AttributeType::NUMBER->value, + ]); + + $option = AttributeOption::factory()->create([ + 'index' => 1, + 'attribute_id' => $attribute->getKey(), + ]); + + $this->product->attributes()->attach($attribute->getKey()); + $this->product->attributes->first()->pivot->options()->attach($option->getKey()); + + $this + ->actingAs($this->{$user}) + ->json('DELETE', 'attributes/id:' . $attribute->getKey() . '/options/id:' . $option->getKey()) + ->assertNoContent(); + + $this->assertDatabaseHas('products', [ + 'id' => $this->product->getKey(), + 'name' => 'Searched product', + 'description_html' => 'Lorem ipsum', + 'search_values' => 'Attribute', + ]); + } +} diff --git a/tests/Feature/Products/ProductSortTest.php b/tests/Feature/Products/ProductSortTest.php index 624b7454a..a8b017a18 100644 --- a/tests/Feature/Products/ProductSortTest.php +++ b/tests/Feature/Products/ProductSortTest.php @@ -49,7 +49,7 @@ private function createProductWithAttribute(Attribute $attribute, string $option ]); $product->attributes()->attach($attribute->getKey()); $product->attributes()->get()->each( - fn (Attribute $attribute) => $attribute->pivot->options()->attach($option->getKey()) + fn (Attribute $attribute) => $attribute->pivot->options()->attach($option->getKey()), ); return $product; diff --git a/tests/Feature/ProviderTest.php b/tests/Feature/ProviderTest.php index e98cda525..0d63a75fb 100644 --- a/tests/Feature/ProviderTest.php +++ b/tests/Feature/ProviderTest.php @@ -270,7 +270,7 @@ public function testLoginNewUser($key): void "auth/providers/{$key}/login", [ 'return_url' => 'https://example.com?code=test', - ] + ], ); $response->assertJsonStructure( @@ -290,7 +290,7 @@ public function testLoginNewUser($key): void 'permissions', ], ], - ] + ], ); } @@ -327,7 +327,7 @@ public function testLoginExistingUser($key): void "auth/providers/{$key}/login", [ 'return_url' => 'https://example.com?code=test', - ] + ], ); $response->assertJsonStructure( @@ -347,7 +347,7 @@ public function testLoginExistingUser($key): void 'permissions', ], ], - ] + ], ); } @@ -378,7 +378,7 @@ public function testLoginExistingStandardUserRegistered($key): void "auth/providers/{$key}/login", [ 'return_url' => 'https://example.com?code=test', - ] + ], ) ->assertStatus(JsonResponse::HTTP_UNPROCESSABLE_ENTITY) ->assertJsonFragment(['message' => Exceptions::CLIENT_ALREADY_HAS_ACCOUNT]); @@ -429,7 +429,7 @@ public function testLoginExistingStandardUserRegisteredAndProviderAlreadyUsed($k "auth/providers/{$key}/login", [ 'return_url' => 'https://example.com?code=test', - ] + ], ) ->assertStatus(JsonResponse::HTTP_UNPROCESSABLE_ENTITY) ->assertJsonFragment(['message' => Exceptions::CLIENT_ALREADY_HAS_ACCOUNT]); diff --git a/tests/Feature/ShippingMethodTest.php b/tests/Feature/ShippingMethodTest.php index 462a0da67..8f85fc2ec 100644 --- a/tests/Feature/ShippingMethodTest.php +++ b/tests/Feature/ShippingMethodTest.php @@ -816,7 +816,7 @@ public function testUpdateWithEmptyData($user): void $response = $this->actingAs($this->{$user})->patchJson( '/shipping-methods/id:' . $this->shipping_method->getKey(), - [] + [], ); $response diff --git a/tests/Feature/UserTest.php b/tests/Feature/UserTest.php index 2d477353e..8693cc42e 100644 --- a/tests/Feature/UserTest.php +++ b/tests/Feature/UserTest.php @@ -834,7 +834,7 @@ public function testCreateRolesMissingPermissions($user): void return str_contains( $message, 'ClientException(code: 422): ' - . "Can't give a role with permissions you don't have to the user at" + . "Can't give a role with permissions you don't have to the user at", ); }); diff --git a/tests/Support/ElasticTest.php b/tests/Support/ElasticTest.php deleted file mode 100644 index d1d4de3c8..000000000 --- a/tests/Support/ElasticTest.php +++ /dev/null @@ -1,36 +0,0 @@ -instance( - ElasticClientFactory::class, - ElasticClientFactory::fake(new FakeResponse(200, $response)), - ); - } - - public function assertElasticQuery(array $query, ?int $limit = null, ?array $sort = null): void - { - $sort ??= []; - $this->assertEquals( - [ - 'query' => $query, - 'from' => 0, - 'size' => $limit ?? Config::get('pagination.per_page'), - 'track_total_hits' => true, - ] + $sort, - ElasticEngine::debug()->array(), - 'Failed to assert that elastic query matched the expected', - ); - } -} diff --git a/tests/Support/fake-response.json b/tests/Support/fake-response.json deleted file mode 100644 index 383859cba..000000000 --- a/tests/Support/fake-response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "took" : 4, - "timed_out" : false, - "_shards" : { - "total" : 1, - "successful" : 1, - "skipped" : 0, - "failed" : 0 - }, - "hits" : { - "total" : { - "value" : 0, - "relation" : "eq" - }, - "max_score" : 3.4428797, - "hits" : [] - } -} diff --git a/tests/TestCase.php b/tests/TestCase.php index d03614e80..83946d814 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,13 +15,11 @@ use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; -use Tests\Support\ElasticTest; use Tests\Traits\JsonQueryCounter; abstract class TestCase extends BaseTestCase { use CreatesApplication; - use ElasticTest; use JsonQueryCounter; use RefreshDatabase; @@ -35,8 +33,6 @@ public function setUp(): void { parent::setUp(); - $this->fakeElastic(); - $seeder = new InitSeeder(); $seeder->run(); @@ -61,10 +57,10 @@ protected function tearDown(): void app()->forgetInstances(); } - public function actingAs(Authenticatable $authenticatable, $guard = null): self + public function actingAs(Authenticatable $user, $guard = null): self { $token = $this->tokenService->createToken( - $authenticatable, + $user, new TokenType(TokenType::ACCESS), Str::uuid()->toString(), ); diff --git a/tests/Traits/CreateShippingMethod.php b/tests/Traits/CreateShippingMethod.php index bfa816c7a..9143b80a2 100644 --- a/tests/Traits/CreateShippingMethod.php +++ b/tests/Traits/CreateShippingMethod.php @@ -11,7 +11,7 @@ trait CreateShippingMethod public function createShippingMethod( float $price = 0, - array $payload = ['shipping_type' => ShippingType::ADDRESS] + array $payload = ['shipping_type' => ShippingType::ADDRESS], ): ShippingMethod { $this->shippingMethod = ShippingMethod::factory()->create($payload); $priceRange = $this->shippingMethod->priceRanges()->create([ diff --git a/tests/Unit/AnalyticsServiceTest.php b/tests/Unit/AnalyticsServiceTest.php index 4a126104e..e4e6d3745 100644 --- a/tests/Unit/AnalyticsServiceTest.php +++ b/tests/Unit/AnalyticsServiceTest.php @@ -140,7 +140,7 @@ private function testGetPaymentsOverPeriodGroup( Carbon $groupTwo1, string $labelOne, string $labelTwo, - string $group + string $group, ): void { $order = Order::factory()->create(); diff --git a/tests/Unit/DiscountApplyTest.php b/tests/Unit/DiscountApplyTest.php index 4ea5d1117..32afe0ce8 100644 --- a/tests/Unit/DiscountApplyTest.php +++ b/tests/Unit/DiscountApplyTest.php @@ -293,7 +293,7 @@ public function testApplyDiscountToProduct($type, $value, $result, $discountKind $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDtoWithSchemas, - $discount + $discount, ); $this->assertTrue($orderProduct->price === $result); @@ -330,7 +330,7 @@ public function testApplyDiscountToProductNotAllowList($type, $value, $result, $ $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDtoWithSchemas, - $discount + $discount, ); $this->assertTrue($orderProduct->price === $result); @@ -365,7 +365,7 @@ public function testApplyDiscountToProductInProductSets($type, $value, $result, $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDtoWithSchemas, - $discount + $discount, ); $this->assertTrue($orderProduct->price === $result); @@ -403,7 +403,7 @@ public function testApplyDiscountToProductInProductSetsNotAllowList($type, $valu $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDtoWithSchemas, - $discount + $discount, ); $this->assertTrue($orderProduct->price === $result); @@ -434,7 +434,7 @@ public function testDiscountNotApplyToProduct($type, $value, $result, $discountK $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDto, - $discount + $discount, ); $this->assertTrue($orderProduct->price === 120.0); @@ -467,7 +467,7 @@ public function testDiscountNotApplyToProductNotAllowList($type, $value, $result $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDto, - $discount + $discount, ); $this->assertTrue($orderProduct->price === 120.0); @@ -496,7 +496,7 @@ public function testDiscountNotApplyToProductInProductSets($type, $value, $resul $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDto, - $discount + $discount, ); $this->assertTrue($orderProduct->price === 120.0); @@ -529,7 +529,7 @@ public function testDiscountNotApplyToProductInProductSetsNotAllowList($type, $v $orderProduct = $this->discountService->applyDiscountOnProduct( $this->product, $this->orderProductDto, - $discount + $discount, ); $this->assertTrue($orderProduct->price === 120.0); diff --git a/tests/Unit/DiscountConditionsCheckTest.php b/tests/Unit/DiscountConditionsCheckTest.php index 89c1a3233..db2577129 100644 --- a/tests/Unit/DiscountConditionsCheckTest.php +++ b/tests/Unit/DiscountConditionsCheckTest.php @@ -76,7 +76,7 @@ public function testCheckConditionGroupPass(): void $this->conditionGroup, $cart, 40.0, - ) + ), ); } @@ -102,7 +102,7 @@ public function testCheckConditionGroupFail(): void $this->conditionGroup, $cart, 40.0, - ) + ), ); } @@ -136,7 +136,7 @@ public function testCheckConditionGroupsPass(): void $this->discount, $cart, 120.0, - ) + ), ); } @@ -168,7 +168,7 @@ public function testCheckConditionGroupsFail(): void $this->discount, $cart, 120.0, - ) + ), ); } diff --git a/tests/Unit/ProductServiceTest.php b/tests/Unit/ProductServiceTest.php index f9598883f..2daae7a5d 100644 --- a/tests/Unit/ProductServiceTest.php +++ b/tests/Unit/ProductServiceTest.php @@ -44,7 +44,7 @@ public static function schemaProvider(): array return [ 'optional schema' => array_merge( $base, - [SchemaType::STRING, false, [$price, $price + $schemaPrice]] + [SchemaType::STRING, false, [$price, $price + $schemaPrice]], ), 'boolean schema' => array_merge( $base, diff --git a/tests/Unit/ResetTokenMailTest.php b/tests/Unit/ResetTokenMailTest.php index 46ecaebd1..454ab0332 100644 --- a/tests/Unit/ResetTokenMailTest.php +++ b/tests/Unit/ResetTokenMailTest.php @@ -12,7 +12,7 @@ public function testHasCorrectUrl(): void $notification = new ResetPassword('testtoken', 'https://example.com'); $this->assertTrue( $notification->toMail($this->user) - ->viewData['url'] === 'https://example.com?token=testtoken&email=' . urlencode($this->user->email) + ->viewData['url'] === 'https://example.com?token=testtoken&email=' . urlencode($this->user->email), ); } } diff --git a/tests/Unit/Rules/AttributeSearchTest.php b/tests/Unit/Rules/AttributeSearchTest.php index 6cf7cce7e..8fbb5a2f8 100644 --- a/tests/Unit/Rules/AttributeSearchTest.php +++ b/tests/Unit/Rules/AttributeSearchTest.php @@ -25,7 +25,7 @@ public function testValidateMinMaxPassMin(): void 'value' => [ 'min' => 1, ], - ] + ], )); } diff --git a/tests/Unit/UndotParamsTest.php b/tests/Unit/UndotParamsTest.php index 341c5ac56..edc1526e9 100644 --- a/tests/Unit/UndotParamsTest.php +++ b/tests/Unit/UndotParamsTest.php @@ -34,7 +34,7 @@ public function testUndotParamsMiddlewareNested(): void 'Zagraniczny' => '0', ], ], - $req->metadata + $req->metadata, ); }); } @@ -64,7 +64,7 @@ public function testUndotParamsMiddlewareMixed(): void 'Dystrybucja' => ['Polska', 'Francja'], ], ], - $req->metadata + $req->metadata, ); $this->assertEquals('test', $req->not_related_param); $this->assertNotEquals('Heseya', $req->metadata_Producent); diff --git a/tests/Unit/UrlServiceTest.php b/tests/Unit/UrlServiceTest.php index 98ed2afa9..f19544959 100644 --- a/tests/Unit/UrlServiceTest.php +++ b/tests/Unit/UrlServiceTest.php @@ -49,7 +49,7 @@ public function testUrlSetPath(): void 'https://example.com/path?get=true#fragment', $this->urlService->urlSetPath( 'https://example.com?get=true#fragment', - 'path/' + 'path/', ), ); } @@ -60,7 +60,7 @@ public function testUrlAppendPath(): void 'https://example.com/path/subpath?get=true#fragment', $this->urlService->urlAppendPath( 'https://example.com/path?get=true#fragment', - '/subpath/' + '/subpath/', ), ); } @@ -71,7 +71,7 @@ public function testUrlAppendPathToNone(): void 'https://example.com/path?get=true#fragment', $this->urlService->urlAppendPath( 'https://example.com?get=true#fragment', - '/path/' + '/path/', ), ); }