diff --git a/composer.json b/composer.json index 9fec013228e..cad0c2a67d4 100755 --- a/composer.json +++ b/composer.json @@ -29,7 +29,6 @@ "khaled.alshamaa/ar-php": "^6.0.0", "konekt/concord": "^1.2", "laravel/framework": "^8.0", - "laravel/legacy-factories": "^1.1", "laravel/scout": "^8.0", "laravel/socialite": "^5.0", "laravel/tinker": "^2.0", @@ -43,7 +42,7 @@ "codeception/codeception": "^4.1", "codeception/module-asserts": "^1.1", "codeception/module-filesystem": "^1.0", - "codeception/module-laravel5": "^1.0", + "codeception/module-laravel": "^2.0", "codeception/module-webdriver": "^1.0", "filp/whoops": "^2.0", "mockery/mockery": "^1.3.1", diff --git a/composer.lock b/composer.lock index cbe5fd3c3a1..199bce18ab0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ad18338e686e8f7ba9eaf04d9bfa2374", + "content-hash": "46b4c37f75642ba14f3a2913f0f345cd", "packages": [ { "name": "algolia/algoliasearch-client-php", @@ -165,21 +165,72 @@ ], "time": "2020-11-19T14:10:38+00:00" }, + { + "name": "aws/aws-crt-php", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/awslabs/aws-crt-php.git", + "reference": "3942776a8c99209908ee0b287746263725685732" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/3942776a8c99209908ee0b287746263725685732", + "reference": "3942776a8c99209908ee0b287746263725685732", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.4.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "AWS SDK Common Runtime Team", + "email": "aws-sdk-common-runtime@amazon.com" + } + ], + "description": "AWS Common Runtime for PHP", + "homepage": "http://aws.amazon.com/sdkforphp", + "keywords": [ + "amazon", + "aws", + "crt", + "sdk" + ], + "support": { + "issues": "https://github.com/awslabs/aws-crt-php/issues", + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.0.2" + }, + "time": "2021-09-03T22:57:30+00:00" + }, { "name": "aws/aws-sdk-php", - "version": "3.182.0", + "version": "3.196.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "998e5caf1b1bb52516a32fb8084eb7006ab5ae7d" + "reference": "2845899d05c66a00d88eabbf7cf5d3dbae2da58a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/998e5caf1b1bb52516a32fb8084eb7006ab5ae7d", - "reference": "998e5caf1b1bb52516a32fb8084eb7006ab5ae7d", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2845899d05c66a00d88eabbf7cf5d3dbae2da58a", + "reference": "2845899d05c66a00d88eabbf7cf5d3dbae2da58a", "shasum": "" }, "require": { + "aws/aws-crt-php": "^1.0.2", "ext-json": "*", "ext-pcre": "*", "ext-simplexml": "*", @@ -251,22 +302,22 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.182.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.196.1" }, - "time": "2021-05-17T18:14:44+00:00" + "time": "2021-10-01T18:23:06+00:00" }, { "name": "babenkoivan/elastic-adapter", - "version": "v1.16.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/babenkoivan/elastic-adapter.git", - "reference": "d3b5daa27386956f341c1cf6e1c1d4e872e96496" + "reference": "6e6461c6988cf1bc655fcec2c2aa2beeb3163f55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/babenkoivan/elastic-adapter/zipball/d3b5daa27386956f341c1cf6e1c1d4e872e96496", - "reference": "d3b5daa27386956f341c1cf6e1c1d4e872e96496", + "url": "https://api.github.com/repos/babenkoivan/elastic-adapter/zipball/6e6461c6988cf1bc655fcec2c2aa2beeb3163f55", + "reference": "6e6461c6988cf1bc655fcec2c2aa2beeb3163f55", "shasum": "" }, "require": { @@ -304,7 +355,7 @@ ], "support": { "issues": "https://github.com/babenkoivan/elastic-adapter/issues", - "source": "https://github.com/babenkoivan/elastic-adapter/tree/v1.16.0" + "source": "https://github.com/babenkoivan/elastic-adapter/tree/v1.17.0" }, "funding": [ { @@ -316,7 +367,7 @@ "type": "paypal" } ], - "time": "2021-05-17T20:37:51+00:00" + "time": "2021-07-19T17:33:35+00:00" }, { "name": "babenkoivan/elastic-client", @@ -391,16 +442,16 @@ }, { "name": "babenkoivan/elastic-scout-driver", - "version": "v1.3.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/babenkoivan/elastic-scout-driver.git", - "reference": "3bc0105de26664731a9d5e8a145b010eea8fad4a" + "reference": "2f7751085f385c17154a29f3553071d3be1ca205" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/babenkoivan/elastic-scout-driver/zipball/3bc0105de26664731a9d5e8a145b010eea8fad4a", - "reference": "3bc0105de26664731a9d5e8a145b010eea8fad4a", + "url": "https://api.github.com/repos/babenkoivan/elastic-scout-driver/zipball/2f7751085f385c17154a29f3553071d3be1ca205", + "reference": "2f7751085f385c17154a29f3553071d3be1ca205", "shasum": "" }, "require": { @@ -410,9 +461,9 @@ }, "require-dev": { "babenkoivan/elastic-migrations": "^1.4", - "friendsofphp/php-cs-fixer": "^2.16", + "friendsofphp/php-cs-fixer": "^3.0", "laravel/legacy-factories": "^1.1", - "laravel/scout": "^8.0", + "laravel/scout": "^9.0", "orchestra/testbench": "^6.12", "phpstan/phpstan": "^0.12.32", "phpunit/phpunit": "^9.5" @@ -451,7 +502,7 @@ ], "support": { "issues": "https://github.com/babenkoivan/elastic-scout-driver/issues", - "source": "https://github.com/babenkoivan/elastic-scout-driver/tree/v1.3.0" + "source": "https://github.com/babenkoivan/elastic-scout-driver/tree/v1.6.0" }, "funding": [ { @@ -463,7 +514,7 @@ "type": "paypal" } ], - "time": "2021-02-25T12:18:25+00:00" + "time": "2021-08-09T21:09:19+00:00" }, { "name": "bagistobrasil/bagisto-product-social-share", @@ -511,16 +562,16 @@ }, { "name": "barryvdh/laravel-debugbar", - "version": "v3.5.7", + "version": "v3.6.2", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-debugbar.git", - "reference": "88fd9cfa144b06b2549e9d487fdaec68265e791e" + "reference": "70b89754913fd89fef16d0170a91dbc2a5cd633a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/88fd9cfa144b06b2549e9d487fdaec68265e791e", - "reference": "88fd9cfa144b06b2549e9d487fdaec68265e791e", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/70b89754913fd89fef16d0170a91dbc2a5cd633a", + "reference": "70b89754913fd89fef16d0170a91dbc2a5cd633a", "shasum": "" }, "require": { @@ -580,15 +631,19 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-debugbar/issues", - "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.5.7" + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.6.2" }, "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, { "url": "https://github.com/barryvdh", "type": "github" } ], - "time": "2021-05-13T20:18:35+00:00" + "time": "2021-06-14T14:29:26+00:00" }, { "name": "barryvdh/laravel-dompdf", @@ -658,16 +713,16 @@ }, { "name": "brick/math", - "version": "0.9.2", + "version": "0.9.3", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0" + "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/dff976c2f3487d42c1db75a3b180e2b9f0e72ce0", - "reference": "dff976c2f3487d42c1db75a3b180e2b9f0e72ce0", + "url": "https://api.github.com/repos/brick/math/zipball/ca57d18f028f84f777b2168cd1911b0dee2343ae", + "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae", "shasum": "" }, "require": { @@ -677,7 +732,7 @@ "require-dev": { "php-coveralls/php-coveralls": "^2.2", "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", - "vimeo/psalm": "4.3.2" + "vimeo/psalm": "4.9.2" }, "type": "library", "autoload": { @@ -702,36 +757,39 @@ ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.9.2" + "source": "https://github.com/brick/math/tree/0.9.3" }, "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/brick/math", "type": "tidelift" } ], - "time": "2021-01-20T22:51:39+00:00" + "time": "2021-08-15T20:50:18+00:00" }, { "name": "doctrine/cache", - "version": "1.11.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0" + "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/a9c1b59eba5a08ca2770a76eddb88922f504e8e0", - "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0", + "url": "https://api.github.com/repos/doctrine/cache/zipball/331b4d5dbaeab3827976273e9356b3b453c300ce", + "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce", "shasum": "" }, "require": { "php": "~7.1 || ^8.0" }, "conflict": { - "doctrine/common": ">2.2,<2.4", - "psr/cache": ">=3" + "doctrine/common": ">2.2,<2.4" }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", @@ -740,8 +798,9 @@ "mongodb/mongodb": "^1.1", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", "predis/predis": "~1.0", - "psr/cache": "^1.0 || ^2.0", - "symfony/cache": "^4.4 || ^5.2" + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.2 || ^6.0@dev", + "symfony/var-exporter": "^4.4 || ^5.2 || ^6.0@dev" }, "suggest": { "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" @@ -793,7 +852,7 @@ ], "support": { "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/1.11.0" + "source": "https://github.com/doctrine/cache/tree/2.1.1" }, "funding": [ { @@ -809,37 +868,39 @@ "type": "tidelift" } ], - "time": "2021-04-13T14:46:17+00:00" + "time": "2021-07-17T14:49:29+00:00" }, { "name": "doctrine/dbal", - "version": "2.13.1", + "version": "2.13.4", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "c800380457948e65bbd30ba92cc17cda108bf8c9" + "reference": "2411a55a2a628e6d8dd598388ab13474802c7b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/c800380457948e65bbd30ba92cc17cda108bf8c9", - "reference": "c800380457948e65bbd30ba92cc17cda108bf8c9", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/2411a55a2a628e6d8dd598388ab13474802c7b6e", + "reference": "2411a55a2a628e6d8dd598388ab13474802c7b6e", "shasum": "" }, "require": { - "doctrine/cache": "^1.0", + "doctrine/cache": "^1.0|^2.0", "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.0", "ext-pdo": "*", "php": "^7.1 || ^8" }, "require-dev": { - "doctrine/coding-standard": "8.2.0", - "jetbrains/phpstorm-stubs": "2020.2", - "phpstan/phpstan": "0.12.81", - "phpunit/phpunit": "^7.5.20|^8.5|9.5.0", + "doctrine/coding-standard": "9.0.0", + "jetbrains/phpstorm-stubs": "2021.1", + "phpstan/phpstan": "0.12.99", + "phpunit/phpunit": "^7.5.20|^8.5|9.5.10", + "psalm/plugin-phpunit": "0.16.1", "squizlabs/php_codesniffer": "3.6.0", + "symfony/cache": "^4.4", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", - "vimeo/psalm": "4.6.4" + "vimeo/psalm": "4.10.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -900,7 +961,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/2.13.1" + "source": "https://github.com/doctrine/dbal/tree/2.13.4" }, "funding": [ { @@ -916,7 +977,7 @@ "type": "tidelift" } ], - "time": "2021-04-17T17:30:19+00:00" + "time": "2021-10-02T15:59:26+00:00" }, { "name": "doctrine/deprecations", @@ -1433,35 +1494,32 @@ }, { "name": "elasticsearch/elasticsearch", - "version": "v7.12.0", + "version": "v7.15.0", "source": { "type": "git", "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "25522ef4f16adcf49d7a1db149f2fcf010655b7f" + "reference": "77a4ade87aef8e8e6b84bafb6704cd35ac15742a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/25522ef4f16adcf49d7a1db149f2fcf010655b7f", - "reference": "25522ef4f16adcf49d7a1db149f2fcf010655b7f", + "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/77a4ade87aef8e8e6b84bafb6704cd35ac15742a", + "reference": "77a4ade87aef8e8e6b84bafb6704cd35ac15742a", "shasum": "" }, "require": { "ext-json": ">=1.3.7", "ezimuel/ringphp": "^1.1.2", "php": "^7.3 || ^8.0", - "psr/log": "~1.0" + "psr/log": "^1|^2" }, "require-dev": { - "doctrine/inflector": "^1.3", "ext-yaml": "*", "ext-zip": "*", "mockery/mockery": "^1.2", "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "phpunit/phpunit": "^9.3", "squizlabs/php_codesniffer": "^3.4", - "symfony/finder": "~4.0", - "symfony/yaml": "~4.0", - "symplify/git-wrapper": "~9.0" + "symfony/finder": "~4.0" }, "suggest": { "ext-curl": "*", @@ -1496,31 +1554,32 @@ ], "support": { "issues": "https://github.com/elastic/elasticsearch-php/issues", - "source": "https://github.com/elastic/elasticsearch-php/tree/v7.12.0" + "source": "https://github.com/elastic/elasticsearch-php/tree/v7.15.0" }, - "time": "2021-03-23T18:08:45+00:00" + "time": "2021-09-23T07:05:35+00:00" }, { "name": "enshrined/svg-sanitize", - "version": "0.14.0", + "version": "0.14.1", "source": { "type": "git", "url": "https://github.com/darylldoyle/svg-sanitizer.git", - "reference": "beff89576a72540ee99476aeb9cfe98222e76fb8" + "reference": "307b42066fb0b76b5119f5e1f0826e18fefabe95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/beff89576a72540ee99476aeb9cfe98222e76fb8", - "reference": "beff89576a72540ee99476aeb9cfe98222e76fb8", + "url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/307b42066fb0b76b5119f5e1f0826e18fefabe95", + "reference": "307b42066fb0b76b5119f5e1f0826e18fefabe95", "shasum": "" }, "require": { "ext-dom": "*", - "ext-libxml": "*" + "ext-libxml": "*", + "php": "^7.0 || ^8.0" }, "require-dev": { "codeclimate/php-test-reporter": "^0.1.2", - "phpunit/phpunit": "^6" + "phpunit/phpunit": "^6.5 || ^8.5" }, "type": "library", "autoload": { @@ -1541,9 +1600,9 @@ "description": "An SVG sanitizer for PHP", "support": { "issues": "https://github.com/darylldoyle/svg-sanitizer/issues", - "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.14.0" + "source": "https://github.com/darylldoyle/svg-sanitizer/tree/0.14.1" }, - "time": "2021-01-21T10:13:20+00:00" + "time": "2021-08-09T23:46:54+00:00" }, { "name": "ezimuel/guzzlestreams", @@ -1708,16 +1767,16 @@ }, { "name": "facade/flare-client-php", - "version": "1.8.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/facade/flare-client-php.git", - "reference": "69742118c037f34ee1ef86dc605be4a105d9e984" + "reference": "b2adf1512755637d0cef4f7d1b54301325ac78ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/69742118c037f34ee1ef86dc605be4a105d9e984", - "reference": "69742118c037f34ee1ef86dc605be4a105d9e984", + "url": "https://api.github.com/repos/facade/flare-client-php/zipball/b2adf1512755637d0cef4f7d1b54301325ac78ed", + "reference": "b2adf1512755637d0cef4f7d1b54301325ac78ed", "shasum": "" }, "require": { @@ -1761,7 +1820,7 @@ ], "support": { "issues": "https://github.com/facade/flare-client-php/issues", - "source": "https://github.com/facade/flare-client-php/tree/1.8.0" + "source": "https://github.com/facade/flare-client-php/tree/1.9.1" }, "funding": [ { @@ -1769,28 +1828,27 @@ "type": "github" } ], - "time": "2021-04-30T11:11:50+00:00" + "time": "2021-09-13T12:16:46+00:00" }, { "name": "facade/ignition", - "version": "2.9.0", + "version": "2.14.0", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "e7db3b601ce742568b92648818ef903904d20164" + "reference": "c6126e291bd44ad3fe482537a145fc70e3320598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/e7db3b601ce742568b92648818ef903904d20164", - "reference": "e7db3b601ce742568b92648818ef903904d20164", + "url": "https://api.github.com/repos/facade/ignition/zipball/c6126e291bd44ad3fe482537a145fc70e3320598", + "reference": "c6126e291bd44ad3fe482537a145fc70e3320598", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "facade/flare-client-php": "^1.6", + "facade/flare-client-php": "^1.9.1", "facade/ignition-contracts": "^1.0.2", - "filp/whoops": "^2.4", "illuminate/support": "^7.0|^8.0", "monolog/monolog": "^2.0", "php": "^7.2.5|^8.0", @@ -1846,7 +1904,7 @@ "issues": "https://github.com/facade/ignition/issues", "source": "https://github.com/facade/ignition" }, - "time": "2021-05-05T06:45:12+00:00" + "time": "2021-10-01T12:58:45+00:00" }, { "name": "facade/ignition-contracts", @@ -1903,21 +1961,21 @@ }, { "name": "fakerphp/faker", - "version": "v1.14.1", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1" + "reference": "271d384d216e5e5c468a6b28feedf95d49f83b35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", - "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/271d384d216e5e5c468a6b28feedf95d49f83b35", + "reference": "271d384d216e5e5c468a6b28feedf95d49f83b35", "shasum": "" }, "require": { "php": "^7.1 || ^8.0", - "psr/container": "^1.0", + "psr/container": "^1.0 || ^2.0", "symfony/deprecation-contracts": "^2.2" }, "conflict": { @@ -1937,7 +1995,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "v1.15-dev" + "dev-main": "v1.16-dev" } }, "autoload": { @@ -1962,9 +2020,9 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v.1.14.1" + "source": "https://github.com/FakerPHP/Faker/tree/v1.16.0" }, - "time": "2021-03-30T06:27:33+00:00" + "time": "2021-09-06T14:53:37+00:00" }, { "name": "fideloper/proxy", @@ -2024,77 +2082,6 @@ }, "time": "2020-10-22T13:48:01+00:00" }, - { - "name": "filp/whoops", - "version": "2.12.1", - "source": { - "type": "git", - "url": "https://github.com/filp/whoops.git", - "reference": "c13c0be93cff50f88bbd70827d993026821914dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/c13c0be93cff50f88bbd70827d993026821914dd", - "reference": "c13c0be93cff50f88bbd70827d993026821914dd", - "shasum": "" - }, - "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", - "psr/log": "^1.0.1" - }, - "require-dev": { - "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" - }, - "suggest": { - "symfony/var-dumper": "Pretty print complex values better with var-dumper available", - "whoops/soap": "Formats errors as SOAP responses" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Whoops\\": "src/Whoops/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Filipe Dobreira", - "homepage": "https://github.com/filp", - "role": "Developer" - } - ], - "description": "php error handling for cool kids", - "homepage": "https://filp.github.io/whoops/", - "keywords": [ - "error", - "exception", - "handling", - "library", - "throwable", - "whoops" - ], - "support": { - "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.12.1" - }, - "funding": [ - { - "url": "https://github.com/denis-sokolov", - "type": "github" - } - ], - "time": "2021-04-25T12:00:00+00:00" - }, { "name": "flynsarmy/db-blade-compiler", "version": "5.5.0", @@ -2159,31 +2146,26 @@ }, { "name": "graham-campbell/result-type", - "version": "v1.0.1", + "version": "v1.0.2", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb" + "reference": "84afea85c6841deeea872f36249a206e878a5de0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/7e279d2cd5d7fbb156ce46daada972355cea27bb", - "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/84afea85c6841deeea872f36249a206e878a5de0", + "reference": "84afea85c6841deeea872f36249a206e878a5de0", "shasum": "" }, "require": { - "php": "^7.0|^8.0", - "phpoption/phpoption": "^1.7.3" + "php": "^7.0 || ^8.0", + "phpoption/phpoption": "^1.8" }, "require-dev": { - "phpunit/phpunit": "^6.5|^7.5|^8.5|^9.0" + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "psr-4": { "GrahamCampbell\\ResultType\\": "src/" @@ -2196,7 +2178,7 @@ "authors": [ { "name": "Graham Campbell", - "email": "graham@alt-three.com" + "email": "hello@gjcampbell.co.uk" } ], "description": "An Implementation Of The Result Type", @@ -2209,7 +2191,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.1" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.2" }, "funding": [ { @@ -2221,7 +2203,7 @@ "type": "tidelift" } ], - "time": "2020-04-13T13:17:36+00:00" + "time": "2021-08-28T21:34:50+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2458,26 +2440,26 @@ }, { "name": "intervention/image", - "version": "2.5.1", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/Intervention/image.git", - "reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e" + "reference": "0925f10b259679b5d8ca58f3a2add9255ffcda45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/abbf18d5ab8367f96b3205ca3c89fb2fa598c69e", - "reference": "abbf18d5ab8367f96b3205ca3c89fb2fa598c69e", + "url": "https://api.github.com/repos/Intervention/image/zipball/0925f10b259679b5d8ca58f3a2add9255ffcda45", + "reference": "0925f10b259679b5d8ca58f3a2add9255ffcda45", "shasum": "" }, "require": { "ext-fileinfo": "*", - "guzzlehttp/psr7": "~1.1", + "guzzlehttp/psr7": "~1.1 || ^2.0", "php": ">=5.4.0" }, "require-dev": { "mockery/mockery": "~0.9.2", - "phpunit/phpunit": "^4.8 || ^5.7" + "phpunit/phpunit": "^4.8 || ^5.7 || ^7.5.15" }, "suggest": { "ext-gd": "to use GD library based image processing.", @@ -2526,9 +2508,19 @@ ], "support": { "issues": "https://github.com/Intervention/image/issues", - "source": "https://github.com/Intervention/image/tree/master" + "source": "https://github.com/Intervention/image/tree/2.6.1" }, - "time": "2019-11-02T09:15:47+00:00" + "funding": [ + { + "url": "https://www.paypal.me/interventionphp", + "type": "custom" + }, + { + "url": "https://github.com/Intervention", + "type": "github" + } + ], + "time": "2021-07-22T14:31:53+00:00" }, { "name": "intervention/imagecache", @@ -2599,22 +2591,22 @@ }, { "name": "kalnoy/nestedset", - "version": "v5.0.3", + "version": "v5.0.5", "source": { "type": "git", "url": "https://github.com/lazychaser/laravel-nestedset.git", - "reference": "789a70bce94a7c3bd206fb05fa4b747cf27acbe2" + "reference": "abf4c8602977874368a79eb6648d5d0014b613bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/789a70bce94a7c3bd206fb05fa4b747cf27acbe2", - "reference": "789a70bce94a7c3bd206fb05fa4b747cf27acbe2", + "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/abf4c8602977874368a79eb6648d5d0014b613bb", + "reference": "abf4c8602977874368a79eb6648d5d0014b613bb", "shasum": "" }, "require": { - "illuminate/database": "~5.7.0|~5.8.0|^6.0|^7.0|^8.0", - "illuminate/events": "~5.7.0|~5.8.0|^6.0|^7.0|^8.0", - "illuminate/support": "~5.7.0|~5.8.0|^6.0|^7.0|^8.0", + "illuminate/database": "~5.7.0|~5.8.0|^6.0|^7.0|>=8.0 <8.43.0", + "illuminate/events": "~5.7.0|~5.8.0|^6.0|^7.0|>=8.0 <8.43.0", + "illuminate/support": "~5.7.0|~5.8.0|^6.0|^7.0|>=8.0 <8.43.0", "php": ">=7.1.3" }, "require-dev": { @@ -2656,22 +2648,22 @@ ], "support": { "issues": "https://github.com/lazychaser/laravel-nestedset/issues", - "source": "https://github.com/lazychaser/laravel-nestedset/tree/v5.0.3" + "source": "https://github.com/lazychaser/laravel-nestedset/tree/v5.0.5" }, - "time": "2020-12-07T05:59:45+00:00" + "time": "2021-05-28T07:23:48+00:00" }, { "name": "khaled.alshamaa/ar-php", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/khaled-alshamaa/ar-php.git", - "reference": "026b139e724851e4a3396aa23c84735984f6fc65" + "reference": "a3eb0dfe14ea9ba0fa291673c52ae7a75749e35a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/khaled-alshamaa/ar-php/zipball/026b139e724851e4a3396aa23c84735984f6fc65", - "reference": "026b139e724851e4a3396aa23c84735984f6fc65", + "url": "https://api.github.com/repos/khaled-alshamaa/ar-php/zipball/a3eb0dfe14ea9ba0fa291673c52ae7a75749e35a", + "reference": "a3eb0dfe14ea9ba0fa291673c52ae7a75749e35a", "shasum": "" }, "require": { @@ -2711,9 +2703,9 @@ ], "support": { "issues": "https://github.com/khaled-alshamaa/ar-php/issues", - "source": "https://github.com/khaled-alshamaa/ar-php/tree/v6.1.0" + "source": "https://github.com/khaled-alshamaa/ar-php/tree/v6.2.0" }, - "time": "2021-04-30T22:04:14+00:00" + "time": "2021-06-20T18:15:36+00:00" }, { "name": "konekt/concord", @@ -2779,16 +2771,16 @@ }, { "name": "konekt/enum", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/artkonekt/enum.git", - "reference": "da96fadf4eda4bd97cc46937e936a6fa6a1e5c94" + "reference": "e1beb8cbeeef9986b9a576bd996c91528ee9e0bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/artkonekt/enum/zipball/da96fadf4eda4bd97cc46937e936a6fa6a1e5c94", - "reference": "da96fadf4eda4bd97cc46937e936a6fa6a1e5c94", + "url": "https://api.github.com/repos/artkonekt/enum/zipball/e1beb8cbeeef9986b9a576bd996c91528ee9e0bd", + "reference": "e1beb8cbeeef9986b9a576bd996c91528ee9e0bd", "shasum": "" }, "require": { @@ -2823,7 +2815,7 @@ "issues": "https://github.com/artkonekt/enum/issues", "source": "https://github.com/artkonekt/enum" }, - "time": "2020-11-28T21:37:27+00:00" + "time": "2021-09-30T17:56:50+00:00" }, { "name": "konekt/enum-eloquent", @@ -2895,16 +2887,16 @@ }, { "name": "laravel/framework", - "version": "v8.41.0", + "version": "v8.42.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "05417155d886df8710e55c84e12622b52d83c47c" + "reference": "41ec4897a70eb8729cf0ff34a8354413c54e42a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/05417155d886df8710e55c84e12622b52d83c47c", - "reference": "05417155d886df8710e55c84e12622b52d83c47c", + "url": "https://api.github.com/repos/laravel/framework/zipball/41ec4897a70eb8729cf0ff34a8354413c54e42a6", + "reference": "41ec4897a70eb8729cf0ff34a8354413c54e42a6", "shasum": "" }, "require": { @@ -3059,63 +3051,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-05-11T14:00:02+00:00" - }, - { - "name": "laravel/legacy-factories", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/laravel/legacy-factories.git", - "reference": "5e3fe2fd5fda64e20ea5c74c831a7346294e902a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/legacy-factories/zipball/5e3fe2fd5fda64e20ea5c74c831a7346294e902a", - "reference": "5e3fe2fd5fda64e20ea5c74c831a7346294e902a", - "shasum": "" - }, - "require": { - "illuminate/macroable": "^8.0", - "php": "^7.3|^8.0", - "symfony/finder": "^3.4|^4.0|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "laravel": { - "providers": [ - "Illuminate\\Database\\Eloquent\\LegacyFactoryServiceProvider" - ] - } - }, - "autoload": { - "files": [ - "helpers.php" - ], - "psr-4": { - "Illuminate\\Database\\Eloquent\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The legacy version of the Laravel Eloquent factories.", - "homepage": "http://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2020-10-27T14:25:32+00:00" + "time": "2021-05-19T13:03:18+00:00" }, { "name": "laravel/scout", @@ -3188,16 +3124,16 @@ }, { "name": "laravel/socialite", - "version": "v5.2.3", + "version": "v5.2.5", "source": { "type": "git", "url": "https://github.com/laravel/socialite.git", - "reference": "1960802068f81e44b2ae9793932181cf1cb91b5c" + "reference": "fd0f6a3dd963ca480b598649b54f92d81a43617f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/1960802068f81e44b2ae9793932181cf1cb91b5c", - "reference": "1960802068f81e44b2ae9793932181cf1cb91b5c", + "url": "https://api.github.com/repos/laravel/socialite/zipball/fd0f6a3dd963ca480b598649b54f92d81a43617f", + "reference": "fd0f6a3dd963ca480b598649b54f92d81a43617f", "shasum": "" }, "require": { @@ -3253,20 +3189,20 @@ "issues": "https://github.com/laravel/socialite/issues", "source": "https://github.com/laravel/socialite" }, - "time": "2021-04-06T14:38:16+00:00" + "time": "2021-08-31T15:16:26+00:00" }, { "name": "laravel/tinker", - "version": "v2.6.1", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/laravel/tinker.git", - "reference": "04ad32c1a3328081097a181875733fa51f402083" + "reference": "c808a7227f97ecfd9219fbf913bad842ea854ddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/04ad32c1a3328081097a181875733fa51f402083", - "reference": "04ad32c1a3328081097a181875733fa51f402083", + "url": "https://api.github.com/repos/laravel/tinker/zipball/c808a7227f97ecfd9219fbf913bad842ea854ddc", + "reference": "c808a7227f97ecfd9219fbf913bad842ea854ddc", "shasum": "" }, "require": { @@ -3319,28 +3255,29 @@ ], "support": { "issues": "https://github.com/laravel/tinker/issues", - "source": "https://github.com/laravel/tinker/tree/v2.6.1" + "source": "https://github.com/laravel/tinker/tree/v2.6.2" }, - "time": "2021-03-02T16:53:12+00:00" + "time": "2021-09-28T15:47:34+00:00" }, { "name": "laravel/ui", - "version": "v3.2.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/laravel/ui.git", - "reference": "e2478cd0342a92ec1c8c77422553bda8ee004fd0" + "reference": "07d725813350c695c779382cbd6dac0ab8665537" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/ui/zipball/e2478cd0342a92ec1c8c77422553bda8ee004fd0", - "reference": "e2478cd0342a92ec1c8c77422553bda8ee004fd0", + "url": "https://api.github.com/repos/laravel/ui/zipball/07d725813350c695c779382cbd6dac0ab8665537", + "reference": "07d725813350c695c779382cbd6dac0ab8665537", "shasum": "" }, "require": { - "illuminate/console": "^8.0", - "illuminate/filesystem": "^8.0", - "illuminate/support": "^8.0", + "illuminate/console": "^8.42", + "illuminate/filesystem": "^8.42", + "illuminate/support": "^8.42", + "illuminate/validation": "^8.42", "php": "^7.3|^8.0" }, "type": "library", @@ -3376,9 +3313,9 @@ "ui" ], "support": { - "source": "https://github.com/laravel/ui/tree/v3.2.1" + "source": "https://github.com/laravel/ui/tree/v3.3.0" }, - "time": "2021-04-27T18:17:41+00:00" + "time": "2021-05-25T16:45:33+00:00" }, { "name": "lcobucci/jwt", @@ -3444,16 +3381,16 @@ }, { "name": "league/commonmark", - "version": "1.6.2", + "version": "1.6.6", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb" + "reference": "c4228d11e30d7493c6836d20872f9582d8ba6dcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/7d70d2f19c84bcc16275ea47edabee24747352eb", - "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/c4228d11e30d7493c6836d20872f9582d8ba6dcf", + "reference": "c4228d11e30d7493c6836d20872f9582d8ba6dcf", "shasum": "" }, "require": { @@ -3471,7 +3408,7 @@ "github/gfm": "0.29.0", "michelf/php-markdown": "~1.4", "mikehaertl/php-shellcommand": "^1.4", - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^0.12.90", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", "scrutinizer/ocular": "^1.5", "symfony/finder": "^4.2" @@ -3541,20 +3478,20 @@ "type": "tidelift" } ], - "time": "2021-05-12T11:39:41+00:00" + "time": "2021-07-17T17:13:23+00:00" }, { "name": "league/flysystem", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32" + "reference": "18634df356bfd4119fe3d6156bdb990c414c14ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32", - "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/18634df356bfd4119fe3d6156bdb990c414c14ea", + "reference": "18634df356bfd4119fe3d6156bdb990c414c14ea", "shasum": "" }, "require": { @@ -3627,7 +3564,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.4" + "source": "https://github.com/thephpleague/flysystem/tree/1.1.5" }, "funding": [ { @@ -3635,20 +3572,20 @@ "type": "other" } ], - "time": "2021-06-23T21:56:05+00:00" + "time": "2021-08-17T13:49:42+00:00" }, { "name": "league/mime-type-detection", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b38b25d7b372e9fddb00335400467b223349fd7e", + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e", "shasum": "" }, "require": { @@ -3679,7 +3616,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.7.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.8.0" }, "funding": [ { @@ -3691,26 +3628,27 @@ "type": "tidelift" } ], - "time": "2021-01-18T20:58:21+00:00" + "time": "2021-09-25T08:23:19+00:00" }, { "name": "league/oauth1-client", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth1-client.git", - "reference": "1e7e6be2dc543bf466236fb171e5b20e1b06aee6" + "reference": "88dd16b0cff68eb9167bfc849707d2c40ad91ddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/1e7e6be2dc543bf466236fb171e5b20e1b06aee6", - "reference": "1e7e6be2dc543bf466236fb171e5b20e1b06aee6", + "url": "https://api.github.com/repos/thephpleague/oauth1-client/zipball/88dd16b0cff68eb9167bfc849707d2c40ad91ddc", + "reference": "88dd16b0cff68eb9167bfc849707d2c40ad91ddc", "shasum": "" }, "require": { "ext-json": "*", "ext-openssl": "*", "guzzlehttp/guzzle": "^6.0|^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", "php": ">=7.1||>=8.0" }, "require-dev": { @@ -3764,29 +3702,29 @@ ], "support": { "issues": "https://github.com/thephpleague/oauth1-client/issues", - "source": "https://github.com/thephpleague/oauth1-client/tree/v1.9.0" + "source": "https://github.com/thephpleague/oauth1-client/tree/v1.10.0" }, - "time": "2021-01-20T01:40:53+00:00" + "time": "2021-08-15T23:05:49+00:00" }, { "name": "maatwebsite/excel", - "version": "3.1.30", + "version": "3.1.33", "source": { "type": "git", "url": "https://github.com/Maatwebsite/Laravel-Excel.git", - "reference": "aa5d2e4d25c5c8218ea0a15103da95f5f8728953" + "reference": "b2de5ba92c5c1ad9415f0eb7c72838fb3eaaa5b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/aa5d2e4d25c5c8218ea0a15103da95f5f8728953", - "reference": "aa5d2e4d25c5c8218ea0a15103da95f5f8728953", + "url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/b2de5ba92c5c1ad9415f0eb7c72838fb3eaaa5b8", + "reference": "b2de5ba92c5c1ad9415f0eb7c72838fb3eaaa5b8", "shasum": "" }, "require": { "ext-json": "*", "illuminate/support": "5.8.*|^6.0|^7.0|^8.0", "php": "^7.0|^8.0", - "phpoffice/phpspreadsheet": "1.16.*" + "phpoffice/phpspreadsheet": "^1.18" }, "require-dev": { "orchestra/testbench": "^6.0", @@ -3832,7 +3770,7 @@ ], "support": { "issues": "https://github.com/Maatwebsite/Laravel-Excel/issues", - "source": "https://github.com/Maatwebsite/Laravel-Excel/tree/3.1.30" + "source": "https://github.com/Maatwebsite/Laravel-Excel/tree/3.1.33" }, "funding": [ { @@ -3844,7 +3782,7 @@ "type": "github" } ], - "time": "2021-04-06T17:17:02+00:00" + "time": "2021-08-12T15:52:25+00:00" }, { "name": "maennchen/zipstream-php", @@ -3919,16 +3857,16 @@ }, { "name": "markbaker/complex", - "version": "2.0.0", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/MarkBaker/PHPComplex.git", - "reference": "9999f1432fae467bc93c53f357105b4c31bb994c" + "reference": "6f724d7e04606fd8adaa4e3bb381c3e9db09c946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/9999f1432fae467bc93c53f357105b4c31bb994c", - "reference": "9999f1432fae467bc93c53f357105b4c31bb994c", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/6f724d7e04606fd8adaa4e3bb381c3e9db09c946", + "reference": "6f724d7e04606fd8adaa4e3bb381c3e9db09c946", "shasum": "" }, "require": { @@ -3937,11 +3875,7 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "phpcompatibility/php-compatibility": "^9.0", - "phpdocumentor/phpdocumentor": "2.*", - "phploc/phploc": "^4.0", - "phpmd/phpmd": "2.*", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.3", - "sebastian/phpcpd": "^4.0", "squizlabs/php_codesniffer": "^3.4" }, "type": "library", @@ -4012,22 +3946,22 @@ ], "support": { "issues": "https://github.com/MarkBaker/PHPComplex/issues", - "source": "https://github.com/MarkBaker/PHPComplex/tree/PHP8" + "source": "https://github.com/MarkBaker/PHPComplex/tree/2.0.3" }, - "time": "2020-08-26T10:42:07+00:00" + "time": "2021-06-02T09:44:11+00:00" }, { "name": "markbaker/matrix", - "version": "2.1.2", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/MarkBaker/PHPMatrix.git", - "reference": "361c0f545c3172ee26c3d596a0aa03f0cef65e6a" + "reference": "174395a901b5ba0925f1d790fa91bab531074b61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/361c0f545c3172ee26c3d596a0aa03f0cef65e6a", - "reference": "361c0f545c3172ee26c3d596a0aa03f0cef65e6a", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/174395a901b5ba0925f1d790fa91bab531074b61", + "reference": "174395a901b5ba0925f1d790fa91bab531074b61", "shasum": "" }, "require": { @@ -4086,22 +4020,22 @@ ], "support": { "issues": "https://github.com/MarkBaker/PHPMatrix/issues", - "source": "https://github.com/MarkBaker/PHPMatrix/tree/2.1.2" + "source": "https://github.com/MarkBaker/PHPMatrix/tree/2.1.3" }, - "time": "2021-01-23T16:37:31+00:00" + "time": "2021-05-25T15:42:17+00:00" }, { "name": "maximebf/debugbar", - "version": "v1.16.5", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62" + "reference": "0a3532556be0145603f8a9de23e76dc28eed7054" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/6d51ee9e94cff14412783785e79a4e7ef97b9d62", - "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/0a3532556be0145603f8a9de23e76dc28eed7054", + "reference": "0a3532556be0145603f8a9de23e76dc28eed7054", "shasum": "" }, "require": { @@ -4120,7 +4054,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.16-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -4151,30 +4085,30 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.16.5" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.17.1" }, - "time": "2020-12-07T11:07:24+00:00" + "time": "2021-08-01T09:19:02+00:00" }, { "name": "monolog/monolog", - "version": "2.2.0", + "version": "2.3.5", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084" + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084", - "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd4380d6fc37626e2f799f29d91195040137eba9", + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9", "shasum": "" }, "require": { "php": ">=7.2", - "psr/log": "^1.0.1" + "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "provide": { - "psr/log-implementation": "1.0.0" + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" }, "require-dev": { "aws/aws-sdk-php": "^2.4.9 || ^3.0", @@ -4182,14 +4116,14 @@ "elasticsearch/elasticsearch": "^7", "graylog2/gelf-php": "^1.4.2", "mongodb/mongodb": "^1.8", - "php-amqplib/php-amqplib": "~2.4", + "php-amqplib/php-amqplib": "~2.4 || ^3", "php-console/php-console": "^3.1.3", "phpspec/prophecy": "^1.6.1", - "phpstan/phpstan": "^0.12.59", + "phpstan/phpstan": "^0.12.91", "phpunit/phpunit": "^8.5", "predis/predis": "^1.1", "rollbar/rollbar": "^1.3", - "ruflin/elastica": ">=0.90 <7.0.1", + "ruflin/elastica": ">=0.90@dev", "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { @@ -4197,8 +4131,11 @@ "doctrine/couchdb": "Allow sending log messages to a CouchDB server", "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", "ext-mbstring": "Allow to work properly with unicode symbols", "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", @@ -4237,7 +4174,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.2.0" + "source": "https://github.com/Seldaek/monolog/tree/2.3.5" }, "funding": [ { @@ -4249,20 +4186,20 @@ "type": "tidelift" } ], - "time": "2020-12-14T13:15:25+00:00" + "time": "2021-10-01T21:08:31+00:00" }, { "name": "mtdowling/jmespath.php", - "version": "2.6.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/jmespath/jmespath.php.git", - "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb" + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb", - "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/9b87907a81b87bc76d19a7fb2d61e61486ee9edb", + "reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb", "shasum": "" }, "require": { @@ -4270,7 +4207,7 @@ "symfony/polyfill-mbstring": "^1.17" }, "require-dev": { - "composer/xdebug-handler": "^1.4", + "composer/xdebug-handler": "^1.4 || ^2.0", "phpunit/phpunit": "^4.8.36 || ^7.5.15" }, "bin": [ @@ -4308,22 +4245,22 @@ ], "support": { "issues": "https://github.com/jmespath/jmespath.php/issues", - "source": "https://github.com/jmespath/jmespath.php/tree/2.6.0" + "source": "https://github.com/jmespath/jmespath.php/tree/2.6.1" }, - "time": "2020-07-31T21:01:56+00:00" + "time": "2021-06-14T00:11:39+00:00" }, { "name": "myclabs/php-enum", - "version": "1.8.0", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/myclabs/php-enum.git", - "reference": "46cf3d8498b095bd33727b13fd5707263af99421" + "reference": "b942d263c641ddb5190929ff840c68f78713e937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/46cf3d8498b095bd33727b13fd5707263af99421", - "reference": "46cf3d8498b095bd33727b13fd5707263af99421", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/b942d263c641ddb5190929ff840c68f78713e937", + "reference": "b942d263c641ddb5190929ff840c68f78713e937", "shasum": "" }, "require": { @@ -4333,7 +4270,7 @@ "require-dev": { "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "1.*", - "vimeo/psalm": "^4.5.1" + "vimeo/psalm": "^4.6.2" }, "type": "library", "autoload": { @@ -4358,7 +4295,7 @@ ], "support": { "issues": "https://github.com/myclabs/php-enum/issues", - "source": "https://github.com/myclabs/php-enum/tree/1.8.0" + "source": "https://github.com/myclabs/php-enum/tree/1.8.3" }, "funding": [ { @@ -4370,7 +4307,7 @@ "type": "tidelift" } ], - "time": "2021-02-15T16:11:48+00:00" + "time": "2021-07-05T08:18:36+00:00" }, { "name": "namshi/jose", @@ -4441,27 +4378,28 @@ }, { "name": "nesbot/carbon", - "version": "2.48.0", + "version": "2.53.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "d3c447f21072766cddec3522f9468a5849a76147" + "reference": "f4655858a784988f880c1b8c7feabbf02dfdf045" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d3c447f21072766cddec3522f9468a5849a76147", - "reference": "d3c447f21072766cddec3522f9468a5849a76147", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/f4655858a784988f880c1b8c7feabbf02dfdf045", + "reference": "f4655858a784988f880c1b8c7feabbf02dfdf045", "shasum": "" }, "require": { "ext-json": "*", "php": "^7.1.8 || ^8.0", "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16", "symfony/translation": "^3.4 || ^4.0 || ^5.0" }, "require-dev": { "doctrine/orm": "^2.7", - "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", @@ -4475,8 +4413,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev", - "dev-3.x": "3.x-dev" + "dev-3.x": "3.x-dev", + "dev-master": "2.x-dev" }, "laravel": { "providers": [ @@ -4502,15 +4440,15 @@ { "name": "Brian Nesbitt", "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" + "homepage": "https://markido.com" }, { "name": "kylekatarnls", - "homepage": "http://github.com/kylekatarnls" + "homepage": "https://github.com/kylekatarnls" } ], "description": "An API extension for DateTime that supports 281 different languages.", - "homepage": "http://carbon.nesbot.com", + "homepage": "https://carbon.nesbot.com", "keywords": [ "date", "datetime", @@ -4530,20 +4468,20 @@ "type": "tidelift" } ], - "time": "2021-05-07T10:08:30+00:00" + "time": "2021-09-06T09:29:23+00:00" }, { "name": "nikic/php-parser", - "version": "v4.10.5", + "version": "v4.13.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f" + "reference": "50953a2691a922aa1769461637869a0a2faa3f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f", - "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", + "reference": "50953a2691a922aa1769461637869a0a2faa3f53", "shasum": "" }, "require": { @@ -4584,9 +4522,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" }, - "time": "2021-05-03T19:11:20+00:00" + "time": "2021-09-20T12:20:58+00:00" }, { "name": "opis/closure", @@ -4836,16 +4774,16 @@ }, { "name": "phpoffice/phpspreadsheet", - "version": "1.16.0", + "version": "1.18.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "76d4323b85129d0c368149c831a07a3e258b2b50" + "reference": "418cd304e8e6b417ea79c3b29126a25dc4b1170c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/76d4323b85129d0c368149c831a07a3e258b2b50", - "reference": "76d4323b85129d0c368149c831a07a3e258b2b50", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/418cd304e8e6b417ea79c3b29126a25dc4b1170c", + "reference": "418cd304e8e6b417ea79c3b29126a25dc4b1170c", "shasum": "" }, "require": { @@ -4864,20 +4802,23 @@ "ext-zlib": "*", "ezyang/htmlpurifier": "^4.13", "maennchen/zipstream-php": "^2.1", - "markbaker/complex": "^1.5||^2.0", - "markbaker/matrix": "^1.2||^2.0", - "php": "^7.2||^8.0", + "markbaker/complex": "^2.0", + "markbaker/matrix": "^2.0", + "php": "^7.2 || ^8.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", "psr/simple-cache": "^1.0" }, "require-dev": { - "dompdf/dompdf": "^0.8.5", - "friendsofphp/php-cs-fixer": "^2.16", + "dealerdirect/phpcodesniffer-composer-installer": "dev-master", + "dompdf/dompdf": "^1.0", + "friendsofphp/php-cs-fixer": "^2.18", "jpgraph/jpgraph": "^4.0", "mpdf/mpdf": "^8.0", "phpcompatibility/php-compatibility": "^9.3", - "phpunit/phpunit": "^8.5||^9.3", + "phpstan/phpstan": "^0.12.82", + "phpstan/phpstan-phpunit": "^0.12.18", + "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "^3.5", "tecnickcom/tcpdf": "^6.3" }, @@ -4931,35 +4872,35 @@ ], "support": { "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", - "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.16.0" + "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.18.0" }, - "time": "2020-12-31T18:03:49+00:00" + "time": "2021-05-31T18:21:15+00:00" }, { "name": "phpoption/phpoption", - "version": "1.7.5", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525" + "reference": "5455cb38aed4523f99977c4a12ef19da4bfe2a28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/994ecccd8f3283ecf5ac33254543eb0ac946d525", - "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/5455cb38aed4523f99977c4a12ef19da4bfe2a28", + "reference": "5455cb38aed4523f99977c4a12ef19da4bfe2a28", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0" + "php": "^7.0 || ^8.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", - "phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^6.5.14 || ^7.0.20 || ^8.5.19 || ^9.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -4978,7 +4919,7 @@ }, { "name": "Graham Campbell", - "email": "graham@alt-three.com" + "email": "hello@gjcampbell.co.uk" } ], "description": "Option Type for PHP", @@ -4990,7 +4931,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.7.5" + "source": "https://github.com/schmittjoh/php-option/tree/1.8.0" }, "funding": [ { @@ -5002,20 +4943,20 @@ "type": "tidelift" } ], - "time": "2020-07-20T17:29:33+00:00" + "time": "2021-08-28T21:27:29+00:00" }, { "name": "prettus/l5-repository", - "version": "2.7.6", + "version": "2.7.8", "source": { "type": "git", "url": "https://github.com/andersao/l5-repository.git", - "reference": "2bd56801c78becf6a26b0d795312d879e55730cd" + "reference": "2425139f178681553cd77460f75af045a818ecad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/andersao/l5-repository/zipball/2bd56801c78becf6a26b0d795312d879e55730cd", - "reference": "2bd56801c78becf6a26b0d795312d879e55730cd", + "url": "https://api.github.com/repos/andersao/l5-repository/zipball/2425139f178681553cd77460f75af045a818ecad", + "reference": "2425139f178681553cd77460f75af045a818ecad", "shasum": "" }, "require": { @@ -5075,7 +5016,7 @@ "source": "https://github.com/andersao/l5-repository", "wiki": "https://github.com/andersao/l5-repository" }, - "time": "2021-04-22T21:15:10+00:00" + "time": "2021-09-03T21:05:45+00:00" }, { "name": "prettus/laravel-validation", @@ -5607,20 +5548,21 @@ }, { "name": "ramsey/collection", - "version": "1.1.3", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1" + "reference": "eaca1dc1054ddd10cbd83c1461907bee6fb528fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1", - "reference": "28a5c4ab2f5111db6a60b2b4ec84057e0f43b9c1", + "url": "https://api.github.com/repos/ramsey/collection/zipball/eaca1dc1054ddd10cbd83c1461907bee6fb528fa", + "reference": "eaca1dc1054ddd10cbd83c1461907bee6fb528fa", "shasum": "" }, "require": { - "php": "^7.2 || ^8" + "php": "^7.3 || ^8", + "symfony/polyfill-php81": "^1.23" }, "require-dev": { "captainhook/captainhook": "^5.3", @@ -5630,6 +5572,7 @@ "hamcrest/hamcrest-php": "^2", "jangregor/phpstan-prophecy": "^0.8", "mockery/mockery": "^1.3", + "phpspec/prophecy-phpunit": "^2.0", "phpstan/extension-installer": "^1", "phpstan/phpstan": "^0.12.32", "phpstan/phpstan-mockery": "^0.12.5", @@ -5657,7 +5600,7 @@ "homepage": "https://benramsey.com" } ], - "description": "A PHP 7.2+ library for representing and manipulating collections.", + "description": "A PHP library for representing and manipulating collections.", "keywords": [ "array", "collection", @@ -5668,7 +5611,7 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.1.3" + "source": "https://github.com/ramsey/collection/tree/1.2.1" }, "funding": [ { @@ -5680,53 +5623,54 @@ "type": "tidelift" } ], - "time": "2021-01-21T17:40:04+00:00" + "time": "2021-08-06T03:41:06+00:00" }, { "name": "ramsey/uuid", - "version": "4.1.1", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "cd4032040a750077205918c86049aa0f43d22947" + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/cd4032040a750077205918c86049aa0f43d22947", - "reference": "cd4032040a750077205918c86049aa0f43d22947", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", "shasum": "" }, "require": { "brick/math": "^0.8 || ^0.9", "ext-json": "*", - "php": "^7.2 || ^8", + "php": "^7.2 || ^8.0", "ramsey/collection": "^1.0", - "symfony/polyfill-ctype": "^1.8" + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php80": "^1.14" }, "replace": { "rhumsaa/uuid": "self.version" }, "require-dev": { - "codeception/aspect-mock": "^3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7.0", + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.8", - "goaop/framework": "^2", + "ergebnis/composer-normalize": "^2.15", "mockery/mockery": "^1.3", "moontoast/math": "^1.1", "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", "php-mock/php-mock-mockery": "^1.3", - "php-mock/php-mock-phpunit": "^2.5", "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^0.17.1", + "phpbench/phpbench": "^1.0", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^0.12", "phpstan/phpstan-mockery": "^0.12", "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^8.5", - "psy/psysh": "^0.10.0", - "slevomat/coding-standard": "^6.0", + "phpunit/phpunit": "^8.5 || ^9", + "slevomat/coding-standard": "^7.0", "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "3.9.4" + "vimeo/psalm": "^4.9" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", @@ -5739,7 +5683,10 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-main": "4.x-dev" + }, + "captainhook": { + "force-install": true } }, "autoload": { @@ -5755,7 +5702,6 @@ "MIT" ], "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", - "homepage": "https://github.com/ramsey/uuid", "keywords": [ "guid", "identifier", @@ -5763,16 +5709,19 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "rss": "https://github.com/ramsey/uuid/releases.atom", - "source": "https://github.com/ramsey/uuid" + "source": "https://github.com/ramsey/uuid/tree/4.2.3" }, "funding": [ { "url": "https://github.com/ramsey", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" } ], - "time": "2020-08-18T17:17:46+00:00" + "time": "2021-09-25T23:10:38+00:00" }, { "name": "react/promise", @@ -5950,27 +5899,29 @@ }, { "name": "symfony/console", - "version": "v5.2.8", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "864568fdc0208b3eba3638b6000b69d2386e6768" + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/864568fdc0208b3eba3638b6000b69d2386e6768", - "reference": "864568fdc0208b3eba3638b6000b69d2386e6768", + "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2", "symfony/string": "^5.1" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", @@ -5978,10 +5929,10 @@ "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/event-dispatcher": "^4.4|^5.0", @@ -6027,7 +5978,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.2.8" + "source": "https://github.com/symfony/console/tree/v5.3.7" }, "funding": [ { @@ -6043,24 +5994,25 @@ "type": "tidelift" } ], - "time": "2021-05-11T15:45:21+00:00" + "time": "2021-08-25T20:02:16+00:00" }, { "name": "symfony/css-selector", - "version": "v5.2.7", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "59a684f5ac454f066ecbe6daecce6719aed283fb" + "reference": "7fb120adc7f600a59027775b224c13a33530dd90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/59a684f5ac454f066ecbe6daecce6719aed283fb", - "reference": "59a684f5ac454f066ecbe6daecce6719aed283fb", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/7fb120adc7f600a59027775b224c13a33530dd90", + "reference": "7fb120adc7f600a59027775b224c13a33530dd90", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6092,7 +6044,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.3.0-BETA1" + "source": "https://github.com/symfony/css-selector/tree/v5.3.4" }, "funding": [ { @@ -6108,26 +6060,25 @@ "type": "tidelift" } ], - "time": "2021-04-07T16:07:52+00:00" + "time": "2021-07-21T12:38:00+00:00" }, { "name": "symfony/debug", - "version": "v4.4.22", + "version": "v4.4.31", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "45b2136377cca5f10af858968d6079a482bca473" + "reference": "43ede438d4cb52cd589ae5dc070e9323866ba8e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/45b2136377cca5f10af858968d6079a482bca473", - "reference": "45b2136377cca5f10af858968d6079a482bca473", + "url": "https://api.github.com/repos/symfony/debug/zipball/43ede438d4cb52cd589ae5dc070e9323866ba8e0", + "reference": "43ede438d4cb52cd589ae5dc070e9323866ba8e0", "shasum": "" }, "require": { "php": ">=7.1.3", - "psr/log": "~1.0", - "symfony/polyfill-php80": "^1.15" + "psr/log": "^1|^2|^3" }, "conflict": { "symfony/http-kernel": "<3.4" @@ -6161,7 +6112,7 @@ "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.22" + "source": "https://github.com/symfony/debug/tree/v4.4.31" }, "funding": [ { @@ -6177,7 +6128,7 @@ "type": "tidelift" } ], - "time": "2021-04-02T07:50:12+00:00" + "time": "2021-09-24T13:30:14+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6248,22 +6199,21 @@ }, { "name": "symfony/error-handler", - "version": "v5.2.8", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "1416bc16317a8188aabde251afef7618bf4687ac" + "reference": "3bc60d0fba00ae8d1eaa9eb5ab11a2bbdd1fc321" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/1416bc16317a8188aabde251afef7618bf4687ac", - "reference": "1416bc16317a8188aabde251afef7618bf4687ac", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/3bc60d0fba00ae8d1eaa9eb5ab11a2bbdd1fc321", + "reference": "3bc60d0fba00ae8d1eaa9eb5ab11a2bbdd1fc321", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/log": "^1.0", - "symfony/polyfill-php80": "^1.15", + "psr/log": "^1|^2|^3", "symfony/var-dumper": "^4.4|^5.0" }, "require-dev": { @@ -6297,7 +6247,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/v5.2.8" + "source": "https://github.com/symfony/error-handler/tree/v5.3.7" }, "funding": [ { @@ -6313,27 +6263,27 @@ "type": "tidelift" } ], - "time": "2021-05-07T13:42:21+00:00" + "time": "2021-08-28T15:07:08+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.2.4", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d08d6ec121a425897951900ab692b612a61d6240" + "reference": "ce7b20d69c66a20939d8952b617506a44d102130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d08d6ec121a425897951900ab692b612a61d6240", - "reference": "d08d6ec121a425897951900ab692b612a61d6240", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ce7b20d69c66a20939d8952b617506a44d102130", + "reference": "ce7b20d69c66a20939d8952b617506a44d102130", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", "symfony/event-dispatcher-contracts": "^2", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "symfony/dependency-injection": "<4.4" @@ -6343,7 +6293,7 @@ "symfony/event-dispatcher-implementation": "2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2|^3", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/error-handler": "^4.4|^5.0", @@ -6382,7 +6332,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/v5.2.4" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.7" }, "funding": [ { @@ -6398,7 +6348,7 @@ "type": "tidelift" } ], - "time": "2021-02-18T17:12:37+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -6481,20 +6431,21 @@ }, { "name": "symfony/finder", - "version": "v5.2.8", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "eccb8be70d7a6a2230d05f6ecede40f3fdd9e252" + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/eccb8be70d7a6a2230d05f6ecede40f3fdd9e252", - "reference": "eccb8be70d7a6a2230d05f6ecede40f3fdd9e252", + "url": "https://api.github.com/repos/symfony/finder/zipball/a10000ada1e600d109a6c7632e9ac42e8bf2fb93", + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6522,7 +6473,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.2.8" + "source": "https://github.com/symfony/finder/tree/v5.3.7" }, "funding": [ { @@ -6538,7 +6489,7 @@ "type": "tidelift" } ], - "time": "2021-05-10T14:39:23+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/http-client-contracts", @@ -6620,23 +6571,23 @@ }, { "name": "symfony/http-foundation", - "version": "v5.2.8", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e8fbbab7c4a71592985019477532629cb2e142dc" + "reference": "e36c8e5502b4f3f0190c675f1c1f1248a64f04e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e8fbbab7c4a71592985019477532629cb2e142dc", - "reference": "e8fbbab7c4a71592985019477532629cb2e142dc", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e36c8e5502b4f3f0190c675f1c1f1248a64f04e5", + "reference": "e36c8e5502b4f3f0190c675f1c1f1248a64f04e5", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "predis/predis": "~1.0", @@ -6673,7 +6624,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.2.8" + "source": "https://github.com/symfony/http-foundation/tree/v5.3.7" }, "funding": [ { @@ -6689,40 +6640,40 @@ "type": "tidelift" } ], - "time": "2021-05-07T13:41:16+00:00" + "time": "2021-08-27T11:20:35+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.2.8", + "version": "v5.3.9", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "c3cb71ee7e2d3eae5fe1001f81780d6a49b37937" + "reference": "ceaf46a992f60e90645e7279825a830f733a17c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c3cb71ee7e2d3eae5fe1001f81780d6a49b37937", - "reference": "c3cb71ee7e2d3eae5fe1001f81780d6a49b37937", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/ceaf46a992f60e90645e7279825a830f733a17c5", + "reference": "ceaf46a992f60e90645e7279825a830f733a17c5", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/log": "~1.0", + "psr/log": "^1|^2", "symfony/deprecation-contracts": "^2.1", "symfony/error-handler": "^4.4|^5.0", "symfony/event-dispatcher": "^5.0", "symfony/http-client-contracts": "^1.1|^2", - "symfony/http-foundation": "^4.4|^5.0", + "symfony/http-foundation": "^5.3.7", "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "symfony/browser-kit": "<4.4", "symfony/cache": "<5.0", "symfony/config": "<5.0", "symfony/console": "<4.4", - "symfony/dependency-injection": "<5.1.8", + "symfony/dependency-injection": "<5.3", "symfony/doctrine-bridge": "<5.0", "symfony/form": "<5.0", "symfony/http-client": "<5.0", @@ -6734,7 +6685,7 @@ "twig/twig": "<2.13" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { "psr/cache": "^1.0|^2.0|^3.0", @@ -6742,7 +6693,7 @@ "symfony/config": "^5.0", "symfony/console": "^4.4|^5.0", "symfony/css-selector": "^4.4|^5.0", - "symfony/dependency-injection": "^5.1.8", + "symfony/dependency-injection": "^5.3", "symfony/dom-crawler": "^4.4|^5.0", "symfony/expression-language": "^4.4|^5.0", "symfony/finder": "^4.4|^5.0", @@ -6785,7 +6736,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/v5.2.8" + "source": "https://github.com/symfony/http-kernel/tree/v5.3.9" }, "funding": [ { @@ -6801,20 +6752,20 @@ "type": "tidelift" } ], - "time": "2021-05-12T13:27:53+00:00" + "time": "2021-09-28T10:25:11+00:00" }, { "name": "symfony/mime", - "version": "v5.2.7", + "version": "v5.3.8", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "7af452bf51c46f18da00feb32e1ad36db9426515" + "reference": "a756033d0a7e53db389618653ae991eba5a19a11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/7af452bf51c46f18da00feb32e1ad36db9426515", - "reference": "7af452bf51c46f18da00feb32e1ad36db9426515", + "url": "https://api.github.com/repos/symfony/mime/zipball/a756033d0a7e53db389618653ae991eba5a19a11", + "reference": "a756033d0a7e53db389618653ae991eba5a19a11", "shasum": "" }, "require": { @@ -6822,7 +6773,7 @@ "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "egulias/email-validator": "~3.0.0", @@ -6868,7 +6819,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.2.7" + "source": "https://github.com/symfony/mime/tree/v5.3.8" }, "funding": [ { @@ -6884,20 +6835,20 @@ "type": "tidelift" } ], - "time": "2021-04-29T20:47:09+00:00" + "time": "2021-09-10T12:30:38+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -6909,7 +6860,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6947,7 +6898,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" }, "funding": [ { @@ -6963,20 +6914,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342" + "reference": "63b5bb7db83e5673936d6e3b8b3e022ff6474933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/06fb361659649bcfd6a208a0f1fcaf4e827ad342", - "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/63b5bb7db83e5673936d6e3b8b3e022ff6474933", + "reference": "63b5bb7db83e5673936d6e3b8b3e022ff6474933", "shasum": "" }, "require": { @@ -6988,7 +6939,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7027,7 +6978,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.23.0" }, "funding": [ { @@ -7043,20 +6994,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.22.1", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170" + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5601e09b69f26c1828b13b6bb87cb07cddba3170", - "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", "shasum": "" }, "require": { @@ -7068,7 +7019,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7108,7 +7059,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" }, "funding": [ { @@ -7124,20 +7075,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483" + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/2d63434d922daf7da8dd863e7907e67ee3031483", - "reference": "2d63434d922daf7da8dd863e7907e67ee3031483", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65", + "reference": "65bd267525e82759e7d8c4e8ceea44f398838e65", "shasum": "" }, "require": { @@ -7151,7 +7102,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7195,7 +7146,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.23.0" }, "funding": [ { @@ -7211,20 +7162,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "shasum": "" }, "require": { @@ -7236,7 +7187,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7279,7 +7230,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" }, "funding": [ { @@ -7295,20 +7246,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { @@ -7320,7 +7271,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7359,7 +7310,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -7375,7 +7326,7 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-php56", @@ -7447,16 +7398,16 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", "shasum": "" }, "require": { @@ -7465,7 +7416,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7503,7 +7454,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" }, "funding": [ { @@ -7519,20 +7470,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-05-27T09:17:38+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", "shasum": "" }, "require": { @@ -7541,7 +7492,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7582,7 +7533,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" }, "funding": [ { @@ -7598,20 +7549,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.22.1", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { @@ -7620,7 +7571,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7665,7 +7616,86 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-28T13:41:28+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "e66119f3de95efc359483f810c4c3e6436279436" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", + "reference": "e66119f3de95efc359483f810c4c3e6436279436", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" }, "funding": [ { @@ -7681,25 +7711,25 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-05-21T13:25:03+00:00" }, { "name": "symfony/process", - "version": "v5.2.7", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e" + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e", - "reference": "98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e", + "url": "https://api.github.com/repos/symfony/process/zipball/38f26c7d6ed535217ea393e05634cb0b244a1967", + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -7727,7 +7757,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.0-BETA1" + "source": "https://github.com/symfony/process/tree/v5.3.7" }, "funding": [ { @@ -7743,36 +7773,37 @@ "type": "tidelift" } ], - "time": "2021-04-08T10:27:02+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/routing", - "version": "v5.2.7", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "3f0cab2e95b5e92226f34c2c1aa969d3fc41f48c" + "reference": "be865017746fe869007d94220ad3f5297951811b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/3f0cab2e95b5e92226f34c2c1aa969d3fc41f48c", - "reference": "3f0cab2e95b5e92226f34c2c1aa969d3fc41f48c", + "url": "https://api.github.com/repos/symfony/routing/zipball/be865017746fe869007d94220ad3f5297951811b", + "reference": "be865017746fe869007d94220ad3f5297951811b", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { - "symfony/config": "<5.0", + "doctrine/annotations": "<1.12", + "symfony/config": "<5.3", "symfony/dependency-injection": "<4.4", "symfony/yaml": "<4.4" }, "require-dev": { - "doctrine/annotations": "^1.10.4", - "psr/log": "~1.0", - "symfony/config": "^5.0", + "doctrine/annotations": "^1.12", + "psr/log": "^1|^2|^3", + "symfony/config": "^5.3", "symfony/dependency-injection": "^4.4|^5.0", "symfony/expression-language": "^4.4|^5.0", "symfony/http-foundation": "^4.4|^5.0", @@ -7816,7 +7847,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.2.7" + "source": "https://github.com/symfony/routing/tree/v5.3.7" }, "funding": [ { @@ -7832,7 +7863,7 @@ "type": "tidelift" } ], - "time": "2021-04-11T22:55:21+00:00" + "time": "2021-08-04T21:42:42+00:00" }, { "name": "symfony/service-contracts", @@ -7915,16 +7946,16 @@ }, { "name": "symfony/string", - "version": "v5.2.8", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db" + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db", - "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db", + "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", "shasum": "" }, "require": { @@ -7978,7 +8009,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.2.8" + "source": "https://github.com/symfony/string/tree/v5.3.7" }, "funding": [ { @@ -7994,26 +8025,27 @@ "type": "tidelift" } ], - "time": "2021-05-10T14:56:10+00:00" + "time": "2021-08-26T08:00:08+00:00" }, { "name": "symfony/translation", - "version": "v5.2.8", + "version": "v5.3.9", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "445caa74a5986f1cc9dd91a2975ef68fa7cb2068" + "reference": "6e69f3551c1a3356cf6ea8d019bf039a0f8b6886" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/445caa74a5986f1cc9dd91a2975ef68fa7cb2068", - "reference": "445caa74a5986f1cc9dd91a2975ef68fa7cb2068", + "url": "https://api.github.com/repos/symfony/translation/zipball/6e69f3551c1a3356cf6ea8d019bf039a0f8b6886", + "reference": "6e69f3551c1a3356cf6ea8d019bf039a0f8b6886", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/translation-contracts": "^2.3" }, "conflict": { @@ -8027,13 +8059,14 @@ "symfony/translation-implementation": "2.3" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2|^3", "symfony/config": "^4.4|^5.0", "symfony/console": "^4.4|^5.0", "symfony/dependency-injection": "^5.0", "symfony/finder": "^4.4|^5.0", "symfony/http-kernel": "^5.0", "symfony/intl": "^4.4|^5.0", + "symfony/polyfill-intl-icu": "^1.21", "symfony/service-contracts": "^1.1.2|^2", "symfony/yaml": "^4.4|^5.0" }, @@ -8071,7 +8104,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.2.8" + "source": "https://github.com/symfony/translation/tree/v5.3.9" }, "funding": [ { @@ -8087,7 +8120,7 @@ "type": "tidelift" } ], - "time": "2021-05-07T13:41:16+00:00" + "time": "2021-08-26T08:22:53+00:00" }, { "name": "symfony/translation-contracts", @@ -8169,22 +8202,22 @@ }, { "name": "symfony/var-dumper", - "version": "v5.2.8", + "version": "v5.3.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba" + "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d693200a73fae179d27f8f1b16b4faf3e8569eba", - "reference": "d693200a73fae179d27f8f1b16b4faf3e8569eba", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/eaaea4098be1c90c8285543e1356a09c8aa5c8da", + "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "phpunit/phpunit": "<5.4.3", @@ -8237,7 +8270,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.2.8" + "source": "https://github.com/symfony/var-dumper/tree/v5.3.8" }, "funding": [ { @@ -8253,7 +8286,7 @@ "type": "tidelift" } ], - "time": "2021-05-07T13:42:21+00:00" + "time": "2021-09-24T15:59:58+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -8396,31 +8429,31 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.3.0", + "version": "v5.3.1", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56" + "reference": "accaddf133651d4b5cf81a119f25296736ffc850" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", - "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/accaddf133651d4b5cf81a119f25296736ffc850", + "reference": "accaddf133651d4b5cf81a119f25296736ffc850", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.1", + "graham-campbell/result-type": "^1.0.2", "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.7.4", - "symfony/polyfill-ctype": "^1.17", - "symfony/polyfill-mbstring": "^1.17", - "symfony/polyfill-php80": "^1.17" + "phpoption/phpoption": "^1.8", + "symfony/polyfill-ctype": "^1.23", + "symfony/polyfill-mbstring": "^1.23.1", + "symfony/polyfill-php80": "^1.23.1" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1" + "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" }, "suggest": { "ext-filter": "Required to use the boolean validator." @@ -8443,13 +8476,11 @@ "authors": [ { "name": "Graham Campbell", - "email": "graham@alt-three.com", - "homepage": "https://gjcampbell.co.uk/" + "email": "hello@gjcampbell.co.uk" }, { "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "https://vancelucas.com/" + "email": "vance@vancelucas.com" } ], "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", @@ -8460,7 +8491,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.1" }, "funding": [ { @@ -8472,7 +8503,7 @@ "type": "tidelift" } ], - "time": "2021-01-20T15:23:13+00:00" + "time": "2021-10-02T19:24:42+00:00" }, { "name": "voku/portable-ascii", @@ -8823,20 +8854,20 @@ }, { "name": "codeception/lib-innerbrowser", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/Codeception/lib-innerbrowser.git", - "reference": "4b0d89b37fe454e060a610a85280a87ab4f534f1" + "reference": "31b4b56ad53c3464fcb2c0a14d55a51a201bd3c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/lib-innerbrowser/zipball/4b0d89b37fe454e060a610a85280a87ab4f534f1", - "reference": "4b0d89b37fe454e060a610a85280a87ab4f534f1", + "url": "https://api.github.com/repos/Codeception/lib-innerbrowser/zipball/31b4b56ad53c3464fcb2c0a14d55a51a201bd3c2", + "reference": "31b4b56ad53c3464fcb2c0a14d55a51a201bd3c2", "shasum": "" }, "require": { - "codeception/codeception": "*@dev", + "codeception/codeception": "4.*@dev", "ext-dom": "*", "ext-json": "*", "ext-mbstring": "*", @@ -8877,9 +8908,9 @@ ], "support": { "issues": "https://github.com/Codeception/lib-innerbrowser/issues", - "source": "https://github.com/Codeception/lib-innerbrowser/tree/1.5.0" + "source": "https://github.com/Codeception/lib-innerbrowser/tree/1.5.1" }, - "time": "2021-04-23T06:18:29+00:00" + "time": "2021-08-30T15:21:42+00:00" }, { "name": "codeception/module-asserts", @@ -8991,27 +9022,29 @@ "time": "2020-10-24T14:46:40+00:00" }, { - "name": "codeception/module-laravel5", - "version": "1.1.1", + "name": "codeception/module-laravel", + "version": "2.1.0", "source": { "type": "git", - "url": "https://github.com/Codeception/module-laravel5.git", - "reference": "1d8a82f78a6e8c26f49af65d9001fa311785d54b" + "url": "https://github.com/Codeception/module-laravel.git", + "reference": "91e812bfa0219276b04d327dab6eafa64d5e802c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-laravel5/zipball/1d8a82f78a6e8c26f49af65d9001fa311785d54b", - "reference": "1d8a82f78a6e8c26f49af65d9001fa311785d54b", + "url": "https://api.github.com/repos/Codeception/module-laravel/zipball/91e812bfa0219276b04d327dab6eafa64d5e802c", + "reference": "91e812bfa0219276b04d327dab6eafa64d5e802c", "shasum": "" }, "require": { "codeception/codeception": "^4.0", - "codeception/lib-innerbrowser": "^1.0", - "php": ">=5.6.0 <9.0" + "codeception/lib-innerbrowser": "^1.3", + "ext-json": "*", + "php": "^7.3 | ^8.0" }, "require-dev": { - "codeception/module-asserts": "^1.0", - "codeception/module-rest": "^1.0" + "codeception/module-asserts": "^1.3", + "codeception/module-rest": "^1.2", + "vlucas/phpdotenv": "^3.6 | ^4.1 | ^5.2" }, "type": "library", "autoload": { @@ -9029,32 +9062,36 @@ }, { "name": "Michael Bodnarchuk" + }, + { + "name": "Gustavo Nieves", + "homepage": "https://medium.com/@ganieves" } ], - "description": "Codeception module for Laravel 5 framework", - "homepage": "http://codeception.com/", + "description": "Codeception module for Laravel framework", + "homepage": "https://codeception.com/", "keywords": [ "codeception", - "laravel5" + "laravel" ], "support": { - "issues": "https://github.com/Codeception/module-laravel5/issues", - "source": "https://github.com/Codeception/module-laravel5/tree/1.1.1" + "issues": "https://github.com/Codeception/module-laravel/issues", + "source": "https://github.com/Codeception/module-laravel/tree/2.1.0" }, - "time": "2020-10-28T07:00:17+00:00" + "time": "2021-09-10T04:19:09+00:00" }, { "name": "codeception/module-webdriver", - "version": "1.2.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/Codeception/module-webdriver.git", - "reference": "ebbe729c630415e8caf6b0087e457906f0c6c0c6" + "reference": "baa18b7bf70aa024012f967b5ce5021e1faa9151" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/ebbe729c630415e8caf6b0087e457906f0c6c0c6", - "reference": "ebbe729c630415e8caf6b0087e457906f0c6c0c6", + "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/baa18b7bf70aa024012f967b5ce5021e1faa9151", + "reference": "baa18b7bf70aa024012f967b5ce5021e1faa9151", "shasum": "" }, "require": { @@ -9095,9 +9132,9 @@ ], "support": { "issues": "https://github.com/Codeception/module-webdriver/issues", - "source": "https://github.com/Codeception/module-webdriver/tree/1.2.1" + "source": "https://github.com/Codeception/module-webdriver/tree/1.4.0" }, - "time": "2021-04-23T17:30:57+00:00" + "time": "2021-09-02T12:01:02+00:00" }, { "name": "codeception/phpunit-wrapper", @@ -9251,6 +9288,77 @@ ], "time": "2020-11-10T18:47:58+00:00" }, + { + "name": "filp/whoops", + "version": "2.14.4", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "f056f1fe935d9ed86e698905a957334029899895" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/f056f1fe935d9ed86e698905a957334029899895", + "reference": "f056f1fe935d9ed86e698905a957334029899895", + "shasum": "" + }, + "require": { + "php": "^5.5.9 || ^7.0 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "require-dev": { + "mockery/mockery": "^0.9 || ^1.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.14.4" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2021-10-03T12:00:00+00:00" + }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -9304,16 +9412,16 @@ }, { "name": "mockery/mockery", - "version": "1.4.3", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea" + "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/d1339f64479af1bee0e82a0413813fe5345a54ea", - "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea", + "url": "https://api.github.com/repos/mockery/mockery/zipball/e01123a0e847d52d186c5eb4b9bf58b0c6d00346", + "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346", "shasum": "" }, "require": { @@ -9370,9 +9478,9 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.4.3" + "source": "https://github.com/mockery/mockery/tree/1.4.4" }, - "time": "2021-02-24T09:51:49+00:00" + "time": "2021-09-13T15:28:59+00:00" }, { "name": "myclabs/deep-copy", @@ -9434,33 +9542,32 @@ }, { "name": "nunomaduro/collision", - "version": "v5.4.0", + "version": "v5.10.0", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "41b7e9999133d5082700d31a1d0977161df8322a" + "reference": "3004cfa49c022183395eabc6d0e5207dfe498d00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/41b7e9999133d5082700d31a1d0977161df8322a", - "reference": "41b7e9999133d5082700d31a1d0977161df8322a", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/3004cfa49c022183395eabc6d0e5207dfe498d00", + "reference": "3004cfa49c022183395eabc6d0e5207dfe498d00", "shasum": "" }, "require": { "facade/ignition-contracts": "^1.0", - "filp/whoops": "^2.7.2", + "filp/whoops": "^2.14.3", "php": "^7.3 || ^8.0", "symfony/console": "^5.0" }, "require-dev": { "brianium/paratest": "^6.1", "fideloper/proxy": "^4.4.1", - "friendsofphp/php-cs-fixer": "^2.17.3", "fruitcake/laravel-cors": "^2.0.3", - "laravel/framework": "^9.0", + "laravel/framework": "8.x-dev", "nunomaduro/larastan": "^0.6.2", "nunomaduro/mock-final-classes": "^1.0", - "orchestra/testbench": "^7.0", + "orchestra/testbench": "^6.0", "phpstan/phpstan": "^0.12.64", "phpunit/phpunit": "^9.5.0" }, @@ -9518,20 +9625,20 @@ "type": "patreon" } ], - "time": "2021-04-09T13:38:32+00:00" + "time": "2021-09-20T15:06:32+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { @@ -9576,9 +9683,9 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" + "source": "https://github.com/phar-io/manifest/tree/2.0.3" }, - "time": "2020-06-27T14:33:11+00:00" + "time": "2021-07-20T11:28:43+00:00" }, { "name": "phar-io/version", @@ -9633,16 +9740,16 @@ }, { "name": "php-webdriver/webdriver", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/php-webdriver/php-webdriver.git", - "reference": "66adc952127dd1314af94ce28f8fc332d38f229b" + "reference": "da16e39968f8dd5cfb7d07eef91dc2b731c69880" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/66adc952127dd1314af94ce28f8fc332d38f229b", - "reference": "66adc952127dd1314af94ce28f8fc332d38f229b", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/da16e39968f8dd5cfb7d07eef91dc2b731c69880", + "reference": "da16e39968f8dd5cfb7d07eef91dc2b731c69880", "shasum": "" }, "require": { @@ -9670,11 +9777,6 @@ "ext-SimpleXML": "For Firefox profile creation" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.8.x-dev" - } - }, "autoload": { "psr-4": { "Facebook\\WebDriver\\": "lib/" @@ -9698,9 +9800,9 @@ ], "support": { "issues": "https://github.com/php-webdriver/php-webdriver/issues", - "source": "https://github.com/php-webdriver/php-webdriver/tree/1.11.0" + "source": "https://github.com/php-webdriver/php-webdriver/tree/1.11.1" }, - "time": "2021-05-03T10:19:43+00:00" + "time": "2021-05-21T15:12:49+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -9813,16 +9915,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { @@ -9830,7 +9932,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -9856,39 +9959,39 @@ "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.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, - "time": "2020-09-17T18:55:26+00:00" + "time": "2021-10-02T14:08:47+00:00" }, { "name": "phpspec/prophecy", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", + "php": "^7.2 || ~8.0, <8.2", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^6.0", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -9923,29 +10026,29 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" }, - "time": "2021-03-17T13:42:18+00:00" + "time": "2021-09-10T09:02:12+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.6", + "version": "9.2.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f6293e1b30a2354e8428e004689671b83871edde" + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", - "reference": "f6293e1b30a2354e8428e004689671b83871edde", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218", + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.10.2", + "nikic/php-parser": "^4.12.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -9994,7 +10097,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7" }, "funding": [ { @@ -10002,7 +10105,7 @@ "type": "github" } ], - "time": "2021-03-28T07:26:59+00:00" + "time": "2021-09-17T05:39:03+00:00" }, { "name": "phpunit/php-file-iterator", @@ -10247,16 +10350,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.4", + "version": "9.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c73c6737305e779771147af66c96ca6a7ed8a741" + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c73c6737305e779771147af66c96ca6a7ed8a741", - "reference": "c73c6737305e779771147af66c96ca6a7ed8a741", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", "shasum": "" }, "require": { @@ -10268,11 +10371,11 @@ "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.1", + "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-code-coverage": "^9.2.7", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -10286,7 +10389,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3", + "sebastian/type": "^2.3.4", "sebastian/version": "^3.0.2" }, "require-dev": { @@ -10334,7 +10437,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.4" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" }, "funding": [ { @@ -10346,7 +10449,7 @@ "type": "github" } ], - "time": "2021-03-23T07:16:29+00:00" + "time": "2021-09-25T07:38:51+00:00" }, { "name": "sebastian/cli-parser", @@ -10854,16 +10957,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.2", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { @@ -10906,7 +11009,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" }, "funding": [ { @@ -10914,7 +11017,7 @@ "type": "github" } ], - "time": "2020-10-26T15:55:19+00:00" + "time": "2021-06-11T13:31:12+00:00" }, { "name": "sebastian/lines-of-code", @@ -11205,16 +11308,16 @@ }, { "name": "sebastian/type", - "version": "2.3.1", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { @@ -11249,7 +11352,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.1" + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" }, "funding": [ { @@ -11257,7 +11360,7 @@ "type": "github" } ], - "time": "2020-10-26T13:18:59+00:00" + "time": "2021-06-15T12:49:02+00:00" }, { "name": "sebastian/version", @@ -11314,21 +11417,22 @@ }, { "name": "symfony/browser-kit", - "version": "v5.2.7", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "b1c9d5701273a255da3a580f85066b83bd94e97d" + "reference": "c1e3f64fcc631c96e2c5843b666db66679ced11c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/b1c9d5701273a255da3a580f85066b83bd94e97d", - "reference": "b1c9d5701273a255da3a580f85066b83bd94e97d", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c1e3f64fcc631c96e2c5843b666db66679ced11c", + "reference": "c1e3f64fcc631c96e2c5843b666db66679ced11c", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/dom-crawler": "^4.4|^5.0" + "symfony/dom-crawler": "^4.4|^5.0", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "symfony/css-selector": "^4.4|^5.0", @@ -11365,7 +11469,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.2.7" + "source": "https://github.com/symfony/browser-kit/tree/v5.3.4" }, "funding": [ { @@ -11381,27 +11485,28 @@ "type": "tidelift" } ], - "time": "2021-04-08T10:27:02+00:00" + "time": "2021-07-21T12:40:44+00:00" }, { "name": "symfony/dom-crawler", - "version": "v5.2.4", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "400e265163f65aceee7e904ef532e15228de674b" + "reference": "c7eef3a60ccfdd8eafe07f81652e769ac9c7146c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/400e265163f65aceee7e904ef532e15228de674b", - "reference": "400e265163f65aceee7e904ef532e15228de674b", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c7eef3a60ccfdd8eafe07f81652e769ac9c7146c", + "reference": "c7eef3a60ccfdd8eafe07f81652e769ac9c7146c", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "masterminds/html5": "<2.6" @@ -11439,7 +11544,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.2.4" + "source": "https://github.com/symfony/dom-crawler/tree/v5.3.7" }, "funding": [ { @@ -11455,20 +11560,20 @@ "type": "tidelift" } ], - "time": "2021-02-15T18:55:04+00:00" + "time": "2021-08-29T19:32:13+00:00" }, { "name": "symfony/yaml", - "version": "v5.2.7", + "version": "v5.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "76546cbeddd0a9540b4e4e57eddeec3e9bb444a5" + "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/76546cbeddd0a9540b4e4e57eddeec3e9bb444a5", - "reference": "76546cbeddd0a9540b4e4e57eddeec3e9bb444a5", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", + "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", "shasum": "" }, "require": { @@ -11514,7 +11619,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.2.7" + "source": "https://github.com/symfony/yaml/tree/v5.3.6" }, "funding": [ { @@ -11530,20 +11635,20 @@ "type": "tidelift" } ], - "time": "2021-04-29T20:47:09+00:00" + "time": "2021-07-29T06:20:01+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { @@ -11572,7 +11677,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, "funding": [ { @@ -11580,7 +11685,7 @@ "type": "github" } ], - "time": "2020-07-12T23:59:07+00:00" + "time": "2021-07-28T10:34:58+00:00" } ], "aliases": [], @@ -11594,5 +11699,5 @@ "php": "^7.3|^8.0" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 467777c5f6f..3afecc955ae 100755 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -1,23 +1,47 @@ define(App\User::class, function (Faker $faker) { - return [ - 'name' => $faker->name, - 'email' => $faker->unique()->safeEmail, - 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret - 'remember_token' => str_random(10), - ]; -}); \ No newline at end of file +class UserFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = User::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'name' => $this->faker->name(), + 'email' => $this->faker->unique()->safeEmail(), + 'email_verified_at' => now(), + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'remember_token' => Str::random(10), + ]; + } + + /** + * Indicate that the model's email address should be unverified. + * + * @return \Illuminate\Database\Eloquent\Factories\Factory + */ + public function unverified() + { + return $this->state(function (array $attributes) { + return [ + 'email_verified_at' => null, + ]; + }); + } +} \ No newline at end of file diff --git a/packages/Webkul/API/Http/Resources/Catalog/Attribute.php b/packages/Webkul/API/Http/Resources/Catalog/Attribute.php index ca65e863ee8..06ba80f5ad0 100644 --- a/packages/Webkul/API/Http/Resources/Catalog/Attribute.php +++ b/packages/Webkul/API/Http/Resources/Catalog/Attribute.php @@ -12,7 +12,7 @@ class Attribute extends JsonResource * @param \Illuminate\Http\Request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'id' => $this->id, diff --git a/packages/Webkul/API/Http/Resources/Catalog/AttributeOption.php b/packages/Webkul/API/Http/Resources/Catalog/AttributeOption.php index e0a9a8a5ea8..15c7cca430e 100644 --- a/packages/Webkul/API/Http/Resources/Catalog/AttributeOption.php +++ b/packages/Webkul/API/Http/Resources/Catalog/AttributeOption.php @@ -12,13 +12,13 @@ class AttributeOption extends JsonResource * @param \Illuminate\Http\Request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'id' => $this->id, 'admin_name' => $this->admin_name, 'label' => $this->label, - 'swatch_value' => $this->swatch_value + 'swatch_value' => $this->swatch_value, ]; } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Factories/AttributeFactory.php b/packages/Webkul/Attribute/src/Database/Factories/AttributeFactory.php index 507f8bcdfe8..b5af6698c07 100644 --- a/packages/Webkul/Attribute/src/Database/Factories/AttributeFactory.php +++ b/packages/Webkul/Attribute/src/Database/Factories/AttributeFactory.php @@ -1,84 +1,142 @@ define(Attribute::class, function (Faker $faker, array $attributes) { - $types = [ - 'text', - 'textarea', - 'price', - 'boolean', - 'select', - 'multiselect', - 'datetime', - 'date', - 'image', - 'file', - 'checkbox', - ]; +class AttributeFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Attribute::class; - $locales = Locale::pluck('code')->all(); + /** + * @var array + */ + protected $states = [ + 'validation_numeric', + 'validation_email', + 'validation_decimal', + 'validation_url', + 'required', + 'unique', + 'filterable', + 'configurable', + ]; - // array $attributes does not contain any locale code - if (count(array_diff_key(array_flip($locales), $attributes) ) === count($locales)) { - $localeCode = $locales[0]; + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $types = [ + 'text', + 'textarea', + 'price', + 'boolean', + 'select', + 'multiselect', + 'datetime', + 'date', + 'image', + 'file', + 'checkbox', + ]; - $attributes[$localeCode] = [ - 'name' => $faker->word, + return [ + 'admin_name' => $this->faker->word, + 'code' => $this->faker->word, + 'type' => array_rand($types), + 'validation' => '', + 'position' => $this->faker->randomDigit, + 'is_required' => false, + 'is_unique' => false, + 'value_per_locale' => false, + 'value_per_channel' => false, + 'is_filterable' => false, + 'is_configurable' => false, + 'is_user_defined' => true, + 'is_visible_on_front' => true, + 'swatch_type' => null, + 'use_in_flat' => true, ]; } - return [ - 'admin_name' => $faker->word, - 'code' => $faker->word, - 'type' => array_rand($types), - 'validation' => '', - 'position' => $faker->randomDigit, - 'is_required' => false, - 'is_unique' => false, - 'value_per_locale' => false, - 'value_per_channel' => false, - 'is_filterable' => false, - 'is_configurable' => false, - 'is_user_defined' => true, - 'is_visible_on_front' => true, - 'swatch_type' => null, - 'use_in_flat' => true, - ]; -}); - -$factory->state(Attribute::class, 'validation_numeric', [ - 'validation' => 'numeric', -]); + public function validation_numeric(): AttributeFactory + { + return $this->state(function (array $attributes) { + return [ + 'validation' => 'numeric', + ]; + }); + } -$factory->state(Attribute::class, 'validation_email', [ - 'validation' => 'email', -]); + public function validation_email(): AttributeFactory + { + return $this->state(function (array $attributes) { + return [ + 'validation' => 'email', + ]; + }); + } -$factory->state(Attribute::class, 'validation_decimal', [ - 'validation' => 'decimal', -]); + public function validation_decimal(): AttributeFactory + { + return $this->state(function (array $attributes) { + return [ + 'validation' => 'decimal', + ]; + }); + } -$factory->state(Attribute::class, 'validation_url', [ - 'validation' => 'url', -]); + public function validation_url(): AttributeFactory + { + return $this->state(function (array $attributes) { + return [ + 'validation' => 'url', + ]; + }); + } -$factory->state(Attribute::class, 'required', [ - 'is_required' => true, -]); + public function required(): AttributeFactory + { + return $this->state(function (array $attributes) { + return [ + 'is_required' => true, + ]; + }); + } -$factory->state(Attribute::class, 'unique', [ - 'is_unique' => true, -]); + public function unique(): AttributeFactory + { + return $this->state(function (array $attributes) { + return [ + 'is_unique' => true, + ]; + }); + } -$factory->state(Attribute::class, 'filterable', [ - 'is_filterable' => true, -]); + public function filterable(): AttributeFactory + { + return $this->state(function (array $attributes) { + return [ + 'is_filterable' => true, + ]; + }); + } -$factory->state(Attribute::class, 'configurable', [ - 'is_configurable' => true, -]); \ No newline at end of file + public function configurable(): AttributeFactory + { + return $this->state(function (array $attributes) { + return [ + 'is_configurable' => true, + ]; + }); + } +} diff --git a/packages/Webkul/Attribute/src/Database/Factories/AttributeFamilyFactory.php b/packages/Webkul/Attribute/src/Database/Factories/AttributeFamilyFactory.php index bf4eb0fc5c5..d103d1668aa 100644 --- a/packages/Webkul/Attribute/src/Database/Factories/AttributeFamilyFactory.php +++ b/packages/Webkul/Attribute/src/Database/Factories/AttributeFamilyFactory.php @@ -1,15 +1,32 @@ define(AttributeFamily::class, function (Faker $faker) { - return [ - 'name' => $faker->word(), - 'code' => $faker->word(), - 'is_user_defined' => rand(0, 1), - 'status' => 0, - ]; -}); +class AttributeFamilyFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = AttributeFamily::class; + + /** + * Define the model's default state. + * + * @return array + * @throws \Exception + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'code' => $this->faker->word(), + 'is_user_defined' => random_int(0, 1), + 'status' => 0, + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Database/Factories/AttributeOptionFactory.php b/packages/Webkul/Attribute/src/Database/Factories/AttributeOptionFactory.php index 963717b79b7..ac013681e6d 100644 --- a/packages/Webkul/Attribute/src/Database/Factories/AttributeOptionFactory.php +++ b/packages/Webkul/Attribute/src/Database/Factories/AttributeOptionFactory.php @@ -1,83 +1,32 @@ define(AttributeOption::class, function (Faker $faker, array $attributes) { - - $locales = Locale::pluck('code')->all(); - - // array $attributes does not contain any locale code - if (count(array_diff_key(array_flip($locales), $attributes) ) === count($locales)) { - $localeCode = $locales[0]; - - $attributes[$localeCode] = [ - 'label' => $faker->word, +use Illuminate\Database\Eloquent\Factories\Factory; + +class AttributeOptionFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = AttributeOption::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'admin_name' => $this->faker->word, + 'sort_order' => $this->faker->randomDigit(), + 'attribute_id' => Attribute::factory(['swatch_type' => 'text']), + 'swatch_value' => null, ]; } - - return [ - 'admin_name' => $faker->word, - 'sort_order' => $faker->randomDigit, - 'attribute_id' => function () { - return factory(Attribute::class)->create()->id; - }, - 'swatch_value' => null, - ]; -}); - -$factory->define(AttributeOption::class, function (Faker $faker, array $attributes) { - return [ - 'admin_name' => $faker->word, - 'sort_order' => $faker->randomDigit, - 'attribute_id' => function () { - return factory(Attribute::class) - ->create(['swatch_type' => 'color']) - ->id; - }, - 'swatch_value' => $faker->hexColor, - ]; -}); - -$factory->define(AttributeOption::class, function (Faker $faker, array $attributes) { - return [ - 'admin_name' => $faker->word, - 'sort_order' => $faker->randomDigit, - 'attribute_id' => function () { - return factory(Attribute::class) - ->create(['swatch_type' => 'image']) - ->id; - }, - 'swatch_value' => '/tests/_data/ProductImageExampleForUpload.jpg', - ]; -}); - -$factory->define(AttributeOption::class, function (Faker $faker, array $attributes) { - return [ - 'admin_name' => $faker->word, - 'sort_order' => $faker->randomDigit, - 'attribute_id' => function () { - return factory(Attribute::class) - ->create(['swatch_type' => 'dropdown']) - ->id; - }, - 'swatch_value' => null, - ]; -}); - -$factory->define(AttributeOption::class, function (Faker $faker, array $attributes) { - return [ - 'admin_name' => $faker->word, - 'sort_order' => $faker->randomDigit, - 'attribute_id' => function () { - return factory(Attribute::class) - ->create(['swatch_type' => 'text']) - ->id; - }, - 'swatch_value' => null, - ]; -}); \ No newline at end of file +} \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Models/Attribute.php b/packages/Webkul/Attribute/src/Models/Attribute.php index 73cdfb40396..79f929cb58f 100755 --- a/packages/Webkul/Attribute/src/Models/Attribute.php +++ b/packages/Webkul/Attribute/src/Models/Attribute.php @@ -2,11 +2,17 @@ namespace Webkul\Attribute\Models; +use Illuminate\Database\Eloquent\Builder; use Webkul\Core\Eloquent\TranslatableModel; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Attribute\Database\Factories\AttributeFactory; use Webkul\Attribute\Contracts\Attribute as AttributeContract; class Attribute extends TranslatableModel implements AttributeContract { + use HasFactory; + public $translatedAttributes = ['name']; protected $fillable = [ @@ -33,7 +39,7 @@ class Attribute extends TranslatableModel implements AttributeContract /** * Get the options. */ - public function options() + public function options(): HasMany { return $this->hasMany(AttributeOptionProxy::modelClass()); } @@ -41,11 +47,24 @@ public function options() /** * Scope a query to only include popular users. * - * @param \Illuminate\Database\Eloquent\Builder $query + * @param \Illuminate\Database\Eloquent\Builder $query + * * @return \Illuminate\Database\Eloquent\Builder */ - public function scopeFilterableAttributes($query) + public function scopeFilterableAttributes(Builder $query): Builder + { + return $query->where('is_filterable', 1) + ->where('swatch_type', '<>', 'image') + ->orderBy('position'); + } + + /** + * Create a new factory instance for the model + * + * @return AttributeFactory + */ + protected static function newFactory(): AttributeFactory { - return $query->where('is_filterable', 1)->where('swatch_type', '<>', 'image')->orderBy('position'); + return AttributeFactory::new(); } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Models/AttributeFamily.php b/packages/Webkul/Attribute/src/Models/AttributeFamily.php index c651610e1da..65fcc3b617a 100755 --- a/packages/Webkul/Attribute/src/Models/AttributeFamily.php +++ b/packages/Webkul/Attribute/src/Models/AttributeFamily.php @@ -4,65 +4,86 @@ use Illuminate\Database\Eloquent\Model; use Webkul\Product\Models\ProductProxy; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Attribute\Database\Factories\AttributeFamilyFactory; use Webkul\Attribute\Contracts\AttributeFamily as AttributeFamilyContract; class AttributeFamily extends Model implements AttributeFamilyContract { + use HasFactory; + public $timestamps = false; - protected $fillable = ['code', 'name']; + protected $fillable = [ + 'code', + 'name', + ]; /** - * Get all of the attributes for the attribute groups. + * Get all the attributes for the attribute groups. */ public function custom_attributes() { return (AttributeProxy::modelClass())::join('attribute_group_mappings', 'attributes.id', '=', 'attribute_group_mappings.attribute_id') - ->join('attribute_groups', 'attribute_group_mappings.attribute_group_id', '=', 'attribute_groups.id') - ->join('attribute_families', 'attribute_groups.attribute_family_id', '=', 'attribute_families.id') - ->where('attribute_families.id', $this->id) - ->select('attributes.*'); + ->join('attribute_groups', 'attribute_group_mappings.attribute_group_id', '=', 'attribute_groups.id') + ->join('attribute_families', 'attribute_groups.attribute_family_id', '=', 'attribute_families.id') + ->where('attribute_families.id', $this->id) + ->select('attributes.*'); } /** - * Get all of the comparable attributes which belongs to attribute family. + * Get all the comparable attributes which belongs to attribute family. */ public function getComparableAttributesBelongsToFamily() { return (AttributeProxy::modelClass())::join('attribute_group_mappings', 'attribute_group_mappings.attribute_id', '=', 'attributes.id') - ->select('attributes.*')->where('attributes.is_comparable', 1)->distinct()->get(); + ->select('attributes.*') + ->where('attributes.is_comparable', 1) + ->distinct() + ->get(); } /** - * Get all of the attributes for the attribute groups. + * Get all the attributes for the attribute groups. */ public function getCustomAttributesAttribute() { - return $this->custom_attributes()->get(); + return $this->custom_attributes() + ->get(); } /** - * Get all of the attribute groups. + * Get all the attribute groups. */ - public function attribute_groups() + public function attribute_groups(): HasMany { - return $this->hasMany(AttributeGroupProxy::modelClass())->orderBy('position'); + return $this->hasMany(AttributeGroupProxy::modelClass()) + ->orderBy('position'); } /** - * Get all of the attributes for the attribute groups. + * Get all the attributes for the attribute groups. */ public function getConfigurableAttributesAttribute() { - return $this->custom_attributes()->where('attributes.is_configurable', 1)->where('attributes.type', 'select')->get(); + return $this->custom_attributes() + ->where('attributes.is_configurable', 1) + ->where('attributes.type', 'select') + ->get(); } /** - * Get all of the products. + * Get all the products. */ - public function products() + public function products(): HasMany { return $this->hasMany(ProductProxy::modelClass()); } + + protected static function newFactory(): AttributeFamilyFactory + { + return AttributeFamilyFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Models/AttributeOption.php b/packages/Webkul/Attribute/src/Models/AttributeOption.php index 7ff766c8f96..d99cc818145 100755 --- a/packages/Webkul/Attribute/src/Models/AttributeOption.php +++ b/packages/Webkul/Attribute/src/Models/AttributeOption.php @@ -2,12 +2,16 @@ namespace Webkul\Attribute\Models; -use Illuminate\Support\Facades\Storage; use Webkul\Core\Eloquent\TranslatableModel; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Attribute\Database\Factories\AttributeOptionFactory; use Webkul\Attribute\Contracts\AttributeOption as AttributeOptionContract; class AttributeOption extends TranslatableModel implements AttributeOptionContract { + use HasFactory; + public $timestamps = false; public $translatedAttributes = ['label']; @@ -22,7 +26,7 @@ class AttributeOption extends TranslatableModel implements AttributeOptionContra /** * Get the attribute that owns the attribute option. */ - public function attribute() + public function attribute(): BelongsTo { return $this->belongsTo(AttributeProxy::modelClass()); } @@ -33,10 +37,10 @@ public function attribute() public function swatch_value_url() { if ($this->swatch_value && $this->attribute->swatch_type == 'image') { - return url('cache/small/'.$this->swatch_value); + return url('cache/small/' . $this->swatch_value); } - - return; + + return null; } /** @@ -46,4 +50,9 @@ public function getSwatchValueUrlAttribute() { return $this->swatch_value_url(); } + + protected static function newFactory(): AttributeOptionFactory + { + return AttributeOptionFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Attribute/src/Providers/AttributeServiceProvider.php b/packages/Webkul/Attribute/src/Providers/AttributeServiceProvider.php index 6fa64e7262c..cc37ac69b22 100755 --- a/packages/Webkul/Attribute/src/Providers/AttributeServiceProvider.php +++ b/packages/Webkul/Attribute/src/Providers/AttributeServiceProvider.php @@ -2,7 +2,6 @@ namespace Webkul\Attribute\Providers; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Support\ServiceProvider; class AttributeServiceProvider extends ServiceProvider @@ -12,10 +11,8 @@ class AttributeServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { - $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); - - $this->app->make(EloquentFactory::class)->load(__DIR__ . '/../Database/Factories'); + $this->loadMigrationsFrom(__DIR__.'/../Database/Migrations'); } } \ No newline at end of file diff --git a/packages/Webkul/BookingProduct/src/Database/Factories/BookingProductEventTicketFactory.php b/packages/Webkul/BookingProduct/src/Database/Factories/BookingProductEventTicketFactory.php index 608dd477d6a..e8d018bf9d7 100644 --- a/packages/Webkul/BookingProduct/src/Database/Factories/BookingProductEventTicketFactory.php +++ b/packages/Webkul/BookingProduct/src/Database/Factories/BookingProductEventTicketFactory.php @@ -1,17 +1,31 @@ define(BookingProductEventTicket::class, static function (Faker $faker, array $attributes) { - return [ - 'price' => $faker->randomFloat(4, 3, 900), - 'qty' => $faker->numberBetween(100, 1000), - 'booking_product_id' => static function () { - return factory(BookingProduct::class)->create(['type' => 'event'])->id; - } - ]; -}); \ No newline at end of file +class BookingProductEventTicketFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = BookingProductEventTicket::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'price' => $this->faker->randomFloat(4, 3, 900), + 'qty' => $this->faker->numberBetween(100, 1000), + 'booking_product_id' => BookingProduct::factory(), + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/BookingProduct/src/Database/Factories/BookingProductFactory.php b/packages/Webkul/BookingProduct/src/Database/Factories/BookingProductFactory.php index 738d0e8a327..dadda4250f6 100644 --- a/packages/Webkul/BookingProduct/src/Database/Factories/BookingProductFactory.php +++ b/packages/Webkul/BookingProduct/src/Database/Factories/BookingProductFactory.php @@ -1,22 +1,36 @@ define(BookingProduct::class, function (Faker $faker, array $attributes) { - $bookingTypes = ['event']; +class BookingProductFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = BookingProduct::class; - return [ - 'type' => $bookingTypes[array_rand(['event'])], - 'qty' => $faker->randomNumber(2), - 'available_from' => Carbon::yesterday(), - 'available_to' => Carbon::tomorrow(), - 'product_id' => function () { - return factory(Product::class)->create(['type' => 'booking'])->id; - } - ]; -}); \ No newline at end of file + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $bookingTypes = ['event']; + + return [ + 'type' => $bookingTypes[array_rand(['event'])], + 'qty' => $this->faker->randomNumber(2), + 'available_from' => Carbon::yesterday(), + 'available_to' => Carbon::tomorrow(), + 'product_id' => Product::factory(['type' => 'booking']), + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/BookingProduct/src/Models/BookingProduct.php b/packages/Webkul/BookingProduct/src/Models/BookingProduct.php index 287247fcf12..911f71ef2ce 100644 --- a/packages/Webkul/BookingProduct/src/Models/BookingProduct.php +++ b/packages/Webkul/BookingProduct/src/Models/BookingProduct.php @@ -3,11 +3,14 @@ namespace Webkul\BookingProduct\Models; use Illuminate\Database\Eloquent\Model; -use Webkul\Product\Models\ProductProxy; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\BookingProduct\Database\Factories\BookingProductFactory; use Webkul\BookingProduct\Contracts\BookingProduct as BookingProductContract; class BookingProduct extends Model implements BookingProductContract { + use HasFactory; + protected $fillable = [ 'location', 'show_location', @@ -19,7 +22,13 @@ class BookingProduct extends Model implements BookingProductContract 'product_id', ]; - protected $with = ['default_slot', 'appointment_slot', 'event_tickets', 'rental_slot', 'table_slot']; + protected $with = [ + 'default_slot', + 'appointment_slot', + 'event_tickets', + 'rental_slot', + 'table_slot', + ]; protected $casts = [ 'available_from' => 'datetime', @@ -29,7 +38,7 @@ class BookingProduct extends Model implements BookingProductContract /** * The Product Default Booking that belong to the product booking. */ - public function default_slot() + public function default_slot(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(BookingProductDefaultSlotProxy::modelClass()); } @@ -37,7 +46,7 @@ public function default_slot() /** * The Product Appointment Booking that belong to the product booking. */ - public function appointment_slot() + public function appointment_slot(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(BookingProductAppointmentSlotProxy::modelClass()); } @@ -45,7 +54,7 @@ public function appointment_slot() /** * The Product Event Booking that belong to the product booking. */ - public function event_tickets() + public function event_tickets(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(BookingProductEventTicketProxy::modelClass()); } @@ -53,7 +62,7 @@ public function event_tickets() /** * The Product Rental Booking that belong to the product booking. */ - public function rental_slot() + public function rental_slot(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(BookingProductRentalSlotProxy::modelClass()); } @@ -61,8 +70,18 @@ public function rental_slot() /** * The Product Table Booking that belong to the product booking. */ - public function table_slot() + public function table_slot(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(BookingProductTableSlotProxy::modelClass()); } + + /** + * Create a new factory instance for the model. + * + * @return BookingProductFactory + */ + protected static function newFactory(): BookingProductFactory + { + return BookingProductFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/BookingProduct/src/Models/BookingProductEventTicket.php b/packages/Webkul/BookingProduct/src/Models/BookingProductEventTicket.php index ec35a5788b5..b980669596d 100644 --- a/packages/Webkul/BookingProduct/src/Models/BookingProductEventTicket.php +++ b/packages/Webkul/BookingProduct/src/Models/BookingProductEventTicket.php @@ -3,13 +3,20 @@ namespace Webkul\BookingProduct\Models; use Webkul\Core\Eloquent\TranslatableModel; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\BookingProduct\Database\Factories\BookingProductEventTicketFactory; use Webkul\BookingProduct\Contracts\BookingProductEventTicket as BookingProductEventTicketContract; class BookingProductEventTicket extends TranslatableModel implements BookingProductEventTicketContract { + use HasFactory; + public $timestamps = false; - public $translatedAttributes = ['name', 'description']; + public $translatedAttributes = [ + 'name', + 'description', + ]; protected $fillable = [ 'price', @@ -19,4 +26,14 @@ class BookingProductEventTicket extends TranslatableModel implements BookingProd 'special_price_to', 'booking_product_id', ]; + + /** + * Create a new factory instance for the model. + * + * @return BookingProductEventTicketFactory + */ + protected static function newFactory(): BookingProductEventTicketFactory + { + return BookingProductEventTicketFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/BookingProduct/src/Providers/BookingProductServiceProvider.php b/packages/Webkul/BookingProduct/src/Providers/BookingProductServiceProvider.php index b31d28d7fd8..56d23a57790 100644 --- a/packages/Webkul/BookingProduct/src/Providers/BookingProductServiceProvider.php +++ b/packages/Webkul/BookingProduct/src/Providers/BookingProductServiceProvider.php @@ -2,7 +2,6 @@ namespace Webkul\BookingProduct\Providers; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Support\ServiceProvider; class BookingProductServiceProvider extends ServiceProvider @@ -11,7 +10,6 @@ class BookingProductServiceProvider extends ServiceProvider * Bootstrap services. * * @return void - * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function boot(): void { @@ -28,8 +26,6 @@ public function boot(): void ], 'public'); $this->app->register(EventServiceProvider::class); - - $this->app->make(EloquentFactory::class)->load(__DIR__ . '/../Database/Factories'); } /** @@ -39,8 +35,6 @@ public function boot(): void */ public function register(): void { - $this->mergeConfigFrom( - dirname(__DIR__) . '/Config/product_types.php', 'product_types' - ); + $this->mergeConfigFrom(dirname(__DIR__) . '/Config/product_types.php', 'product_types'); } } \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Models/CartRule.php b/packages/Webkul/CartRule/src/Models/CartRule.php index 23a6af93360..78c32402852 100644 --- a/packages/Webkul/CartRule/src/Models/CartRule.php +++ b/packages/Webkul/CartRule/src/Models/CartRule.php @@ -3,12 +3,16 @@ namespace Webkul\CartRule\Models; use Illuminate\Database\Eloquent\Model; +use Webkul\Core\Database\Factories\CartRuleFactory; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Webkul\CartRule\Contracts\CartRule as CartRuleContract; use Webkul\Core\Models\ChannelProxy; use Webkul\Customer\Models\CustomerGroupProxy; class CartRule extends Model implements CartRuleContract { + use HasFactory; + protected $fillable = [ 'name', 'description', @@ -105,7 +109,8 @@ public function coupons(): \Illuminate\Database\Eloquent\Relations\HasOne */ public function coupon_code(): \Illuminate\Database\Eloquent\Relations\HasOne { - return $this->cart_rule_coupon()->where('is_primary', 1); + return $this->cart_rule_coupon() + ->where('is_primary', 1); } /** @@ -115,12 +120,23 @@ public function coupon_code(): \Illuminate\Database\Eloquent\Relations\HasOne */ public function getCouponCodeAttribute() { - $coupon = $this->coupon_code()->first(); + $coupon = $this->coupon_code() + ->first(); - if (! $coupon) { + if (!$coupon) { return; } return $coupon->code; } + + /** + * Create a new factory instance for the model. + * + * @return CartRuleFactory + */ + protected static function newFactory(): CartRuleFactory + { + return CartRuleFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/CartRule/src/Models/CartRuleCoupon.php b/packages/Webkul/CartRule/src/Models/CartRuleCoupon.php index d072f1ee4c7..767a4a36a10 100644 --- a/packages/Webkul/CartRule/src/Models/CartRuleCoupon.php +++ b/packages/Webkul/CartRule/src/Models/CartRuleCoupon.php @@ -3,10 +3,15 @@ namespace Webkul\CartRule\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Core\Database\Factories\CartRuleCouponFactory; use Webkul\CartRule\Contracts\CartRuleCoupon as CartRuleCouponContract; class CartRuleCoupon extends Model implements CartRuleCouponContract { + use HasFactory; + protected $fillable = [ 'code', 'usage_limit', @@ -21,8 +26,18 @@ class CartRuleCoupon extends Model implements CartRuleCouponContract /** * Get the cart rule that owns the cart rule coupon. */ - public function cart_rule() + public function cart_rule(): BelongsTo { return $this->belongsTo(CartRuleProxy::modelClass()); } + + /** + * Create a new factory instance for the model + * + * @return CartRuleCouponFactory + */ + protected static function newFactory(): CartRuleCouponFactory + { + return CartRuleCouponFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Category/src/Database/Factories/CategoryFactory.php b/packages/Webkul/Category/src/Database/Factories/CategoryFactory.php index 359cae23c18..3c8e36917d9 100644 --- a/packages/Webkul/Category/src/Database/Factories/CategoryFactory.php +++ b/packages/Webkul/Category/src/Database/Factories/CategoryFactory.php @@ -1,18 +1,62 @@ define(Category::class, function (Faker $faker, array $attributes) { +class CategoryFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Category::class; - return [ - 'status' => 1, - 'position' => $faker->randomDigit, - 'parent_id' => 1, + /** + * @var string[] + */ + protected $states = [ + 'inactive', + 'rtl', ]; -}); -$factory->state(Category::class, 'inactive', [ - 'status' => 0, -]); + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'status' => 1, + 'position' => $this->faker->randomDigit(), + 'parent_id' => 1, + ]; + } + + /** + * + */ + public function inactive(): CategoryFactory + { + return $this->state(function (array $attributes) { + return [ + 'status' => 0, + ]; + }); + } + + /** + * Handle rtl state + */ + public function rtl(): CategoryFactory + { + return $this->state(function (array $attributes) { + return [ + 'direction' => 'rtl', + ]; + }); + } +} diff --git a/packages/Webkul/Category/src/Models/Category.php b/packages/Webkul/Category/src/Models/Category.php index 7091e0eac33..894cc9d7572 100755 --- a/packages/Webkul/Category/src/Models/Category.php +++ b/packages/Webkul/Category/src/Models/Category.php @@ -5,6 +5,9 @@ use Webkul\Core\Eloquent\TranslatableModel; use Kalnoy\Nestedset\NodeTrait; use Illuminate\Support\Facades\Storage; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Category\Database\Factories\CategoryFactory; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Webkul\Category\Contracts\Category as CategoryContract; use Webkul\Attribute\Models\AttributeProxy; @@ -20,7 +23,7 @@ */ class Category extends TranslatableModel implements CategoryContract { - use NodeTrait; + use NodeTrait, HasFactory; public $translatedAttributes = [ 'name', @@ -47,8 +50,9 @@ class Category extends TranslatableModel implements CategoryContract */ public function image_url() { - if (! $this->image) + if (!$this->image) { return; + } return Storage::url($this->image); } @@ -61,28 +65,45 @@ public function getImageUrlAttribute() return $this->image_url(); } - /** + /** * The filterable attributes that belong to the category. */ - public function filterableAttributes() + public function filterableAttributes(): BelongsToMany { - return $this->belongsToMany(AttributeProxy::modelClass(), 'category_filterable_attributes')->with(['options' => function($query) { - $query->orderBy('sort_order'); - }]); + return $this->belongsToMany(AttributeProxy::modelClass(), 'category_filterable_attributes') + ->with([ + 'options' => function ($query) { + $query->orderBy('sort_order'); + }, + ]); } /** * Getting the root category of a category * - * @return Category + * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object */ - public function getRootCategory(): Category + public function getRootCategory() { - return Category::where([ - ['parent_id', '=', null], - ['_lft', '<=', $this->_lft], - ['_rgt', '>=', $this->_rgt], - ])->first(); + return self::query() + ->where([ + [ + 'parent_id', + '=', + null, + ], + [ + '_lft', + '<=', + $this->_lft, + ], + [ + '_rgt', + '>=', + $this->_rgt, + ], + ]) + ->first(); } /** @@ -97,7 +118,7 @@ public function getPathCategories(): array $categories = [$category]; while (isset($category->parent)) { - $category = $category->parent; + $category = $category->parent; $categories[] = $category; } @@ -109,18 +130,19 @@ public function getPathCategories(): array * will search in root category by default * is used to minimize the numbers of sql queries for it only uses the already cached tree * - * @param Category[] $categoryTree + * @param Category[] $categoryTree + * * @return Category */ public function findInTree($categoryTree = null): Category { - if (! $categoryTree) { + if (!$categoryTree) { $categoryTree = app(CategoryRepository::class)->getVisibleCategoryTree($this->getRootCategory()->id); } $category = $categoryTree->first(); - if (! $category) { + if (!$category) { throw new NotFoundHttpException('category not found in tree'); } @@ -134,8 +156,18 @@ public function findInTree($categoryTree = null): Category /** * The products that belong to the category. */ - public function products() + public function products(): BelongsToMany { return $this->belongsToMany(ProductProxy::modelClass(), 'product_categories'); } + + /** + * Create a new factory instance for the model. + * + * @return CategoryFactory + */ + protected static function newFactory(): CategoryFactory + { + return CategoryFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Category/src/Providers/CategoryServiceProvider.php b/packages/Webkul/Category/src/Providers/CategoryServiceProvider.php index 0af0c484b98..b31a9a8348c 100755 --- a/packages/Webkul/Category/src/Providers/CategoryServiceProvider.php +++ b/packages/Webkul/Category/src/Providers/CategoryServiceProvider.php @@ -2,7 +2,6 @@ namespace Webkul\Category\Providers; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Support\ServiceProvider; use Webkul\Category\Models\CategoryProxy; use Webkul\Category\Observers\CategoryObserver; @@ -14,23 +13,10 @@ class CategoryServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); CategoryProxy::observe(CategoryObserver::class); - - $this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories'); - } - - /** - * Register factories. - * - * @param string $path - * @return void - */ - protected function registerEloquentFactoriesFrom($path): void - { - $this->app->make(EloquentFactory::class)->load($path); } } \ No newline at end of file diff --git a/packages/Webkul/Checkout/src/Database/Factories/CartAddressFactory.php b/packages/Webkul/Checkout/src/Database/Factories/CartAddressFactory.php index c78b813e79f..aa2e6842304 100644 --- a/packages/Webkul/Checkout/src/Database/Factories/CartAddressFactory.php +++ b/packages/Webkul/Checkout/src/Database/Factories/CartAddressFactory.php @@ -1,15 +1,31 @@ define(CartAddress::class, function (Faker $faker) { - return [ - 'first_name' => $faker->firstName(), - 'last_name' => $faker->lastName, - 'email' => $faker->email, - 'address_type' => CartAddress::ADDRESS_TYPE_BILLING, - ]; -}); +class CartAddressFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = CartAddress::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'first_name' => $this->faker->firstName(), + 'last_name' => $this->faker->lastName, + 'email' => $this->faker->email, + 'address_type' => CartAddress::ADDRESS_TYPE_BILLING, + ]; + } +} diff --git a/packages/Webkul/Checkout/src/Database/Factories/CartFactory.php b/packages/Webkul/Checkout/src/Database/Factories/CartFactory.php index 394c543c9da..3de690a154c 100644 --- a/packages/Webkul/Checkout/src/Database/Factories/CartFactory.php +++ b/packages/Webkul/Checkout/src/Database/Factories/CartFactory.php @@ -1,41 +1,57 @@ orderBy('id', 'desc') + ->select('id') + ->first(); + + $customer = Customer::factory() + ->create(); + + return [ + 'is_guest' => 0, + 'is_active' => 1, + 'customer_id' => $customer->id, + 'customer_email' => $customer->email, + 'customer_first_name' => $customer->first_name, + 'customer_last_name' => $customer->last_name, + 'is_gift' => 0, + 'base_currency_code' => 'EUR', + 'channel_currency_code' => 'EUR', + 'grand_total' => 0.0000, + 'base_grand_total' => 0.0000, + 'sub_total' => 0.0000, + 'base_sub_total' => 0.0000, + 'channel_id' => 1, + 'created_at' => $now, + 'updated_at' => $now, + ]; + } +} -$factory->define(Cart::class, function (Faker $faker) { - $now = date("Y-m-d H:i:s"); - - $lastOrder = DB::table('orders') - ->orderBy('id', 'desc') - ->select('id') - ->first(); - - $customer = factory(Customer::class)->create(); - $cartAddress = factory(CartAddress::class)->create(); - - return [ - 'is_guest' => 0, - 'is_active' => 1, - 'customer_id' => $customer->id, - 'customer_email' => $customer->email, - 'customer_first_name' => $customer->first_name, - 'customer_last_name' => $customer->last_name, - 'is_gift' => 0, - 'base_currency_code' => 'EUR', - 'channel_currency_code' => 'EUR', - 'grand_total' => 0.0000, - 'base_grand_total' => 0.0000, - 'sub_total' => 0.0000, - 'base_sub_total' => 0.0000, - 'channel_id' => 1, - 'created_at' => $now, - 'updated_at' => $now, - ]; -}); diff --git a/packages/Webkul/Checkout/src/Database/Factories/CartItemFactory.php b/packages/Webkul/Checkout/src/Database/Factories/CartItemFactory.php index c43f66dbd7c..dbb884c4965 100644 --- a/packages/Webkul/Checkout/src/Database/Factories/CartItemFactory.php +++ b/packages/Webkul/Checkout/src/Database/Factories/CartItemFactory.php @@ -1,38 +1,55 @@ define(CartItem::class, function (Faker $faker, array $attributes) { - $now = date("Y-m-d H:i:s"); +class CartItemFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = CartItem::class; - if (isset($attributes['product_id'])) { - $product = Product::where('id', $attributes['product_id'])->first(); - } else { - $product = factory(Product::class)->create(); - } + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $now = date("Y-m-d H:i:s"); - $fallbackPrice = $faker->randomFloat(4, 0, 1000); + if (isset($attributes['product_id'])) { + $product = Product::query() + ->where('id', $attributes['product_id']) + ->first(); + } else { + $product = Product::factory() + ->create(); + } - return [ - 'quantity' => 1, - 'sku' => $product->sku, - 'type' => $product->type, - 'name' => $product->name, - 'price' => $product->price ?? $fallbackPrice, - 'base_price' => $product->price ?? $fallbackPrice, - 'total' => $product->price ?? $fallbackPrice, - 'base_total' => $product->price ?? $fallbackPrice, - 'product_id' => $product->id, - 'cart_id' => function () { - return factory(Cart::class)->create()->id; - }, - 'created_at' => $now, - 'updated_at' => $now, - ]; -}); + $fallbackPrice = $this->faker->randomFloat(4, 0, 1000); + return [ + 'quantity' => 1, + 'sku' => $product->sku, + 'type' => $product->type, + 'name' => $product->name, + 'price' => $product->price ?? $fallbackPrice, + 'base_price' => $product->price ?? $fallbackPrice, + 'total' => $product->price ?? $fallbackPrice, + 'base_total' => $product->price ?? $fallbackPrice, + 'product_id' => $product->id, + 'cart_id' => Cart::factory(), + 'created_at' => $now, + 'updated_at' => $now, + ]; + } +} diff --git a/packages/Webkul/Checkout/src/Database/Factories/CartPaymentFactory.php b/packages/Webkul/Checkout/src/Database/Factories/CartPaymentFactory.php index 3d45f70b082..62522f17655 100644 --- a/packages/Webkul/Checkout/src/Database/Factories/CartPaymentFactory.php +++ b/packages/Webkul/Checkout/src/Database/Factories/CartPaymentFactory.php @@ -1,16 +1,34 @@ define(CartPayment::class, function (Faker $faker) { - $now = date("Y-m-d H:i:s"); +class CartPaymentFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = CartPayment::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $now = date("Y-m-d H:i:s"); + + return [ + 'created_at' => $now, + 'updated_at' => $now, + ]; + } +} - return [ - 'created_at' => $now, - 'updated_at' => $now, - ]; -}); diff --git a/packages/Webkul/Checkout/src/Models/Cart.php b/packages/Webkul/Checkout/src/Models/Cart.php index 40bcc42ac48..09f33b416cf 100755 --- a/packages/Webkul/Checkout/src/Models/Cart.php +++ b/packages/Webkul/Checkout/src/Models/Cart.php @@ -4,9 +4,13 @@ use Illuminate\Database\Eloquent\Model; use Webkul\Checkout\Contracts\Cart as CartContract; +use Webkul\Checkout\Database\Factories\CartFactory; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Cart extends Model implements CartContract { + use HasFactory; + protected $table = 'cart'; protected $guarded = [ @@ -23,31 +27,35 @@ class Cart extends Model implements CartContract /** * To get relevant associated items with the cart instance */ - public function items() { - return $this->hasMany(CartItemProxy::modelClass())->whereNull('parent_id'); + public function items(): \Illuminate\Database\Eloquent\Relations\HasMany + { + return $this->hasMany(CartItemProxy::modelClass()) + ->whereNull('parent_id'); } /** * To get all the associated items with the cart instance even the parent and child items of configurable products */ - public function all_items() { + public function all_items(): \Illuminate\Database\Eloquent\Relations\HasMany + { return $this->hasMany(CartItemProxy::modelClass()); } /** * Get the addresses for the cart. */ - public function addresses() + public function addresses(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(CartAddressProxy::modelClass()); } /** - * Get the biling address for the cart. + * Get the billing address for the cart. */ - public function billing_address() + public function billing_address(): \Illuminate\Database\Eloquent\Relations\HasMany { - return $this->addresses()->where('address_type', CartAddress::ADDRESS_TYPE_BILLING); + return $this->addresses() + ->where('address_type', CartAddress::ADDRESS_TYPE_BILLING); } /** @@ -55,15 +63,17 @@ public function billing_address() */ public function getBillingAddressAttribute() { - return $this->billing_address()->first(); + return $this->billing_address() + ->first(); } /** * Get the shipping address for the cart. */ - public function shipping_address() + public function shipping_address(): \Illuminate\Database\Eloquent\Relations\HasMany { - return $this->addresses()->where('address_type', CartAddress::ADDRESS_TYPE_SHIPPING); + return $this->addresses() + ->where('address_type', CartAddress::ADDRESS_TYPE_SHIPPING); } /** @@ -71,37 +81,41 @@ public function shipping_address() */ public function getShippingAddressAttribute() { - return $this->shipping_address()->first(); + return $this->shipping_address() + ->first(); } /** * Get the shipping rates for the cart. */ - public function shipping_rates() + public function shipping_rates(): \Illuminate\Database\Eloquent\Relations\HasManyThrough { return $this->hasManyThrough(CartShippingRateProxy::modelClass(), CartAddressProxy::modelClass(), 'cart_id', 'cart_address_id'); } /** - * Get all of the attributes for the attribute groups. + * Get all the attributes for the attribute groups. */ - public function selected_shipping_rate() + public function selected_shipping_rate(): \Illuminate\Database\Eloquent\Relations\HasManyThrough { - return $this->shipping_rates()->where('method', $this->shipping_method); + return $this->shipping_rates() + ->where('method', $this->shipping_method); } /** - * Get all of the attributes for the attribute groups. + * Get all the attributes for the attribute groups. */ public function getSelectedShippingRateAttribute() { - return $this->selected_shipping_rate()->where('method', $this->shipping_method)->first(); + return $this->selected_shipping_rate() + ->where('method', $this->shipping_method) + ->first(); } /** * Get the payment associated with the cart. */ - public function payment() + public function payment(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(CartPaymentProxy::modelClass()); } @@ -111,7 +125,7 @@ public function payment() * * @return boolean */ - public function haveStockableItems() + public function haveStockableItems(): bool { foreach ($this->items as $item) { if ($item->product->isStockable()) { @@ -127,10 +141,10 @@ public function haveStockableItems() * * @return boolean */ - public function hasDownloadableItems() + public function hasDownloadableItems(): bool { foreach ($this->items as $item) { - if (stristr($item->type,'downloadable') !== false) { + if (stristr($item->type, 'downloadable') !== false) { return true; } } @@ -141,12 +155,14 @@ public function hasDownloadableItems() /** * Returns true if cart contains one or many products with quantity box. * (for example: simple, configurable, virtual) + * * @return bool */ public function hasProductsWithQuantityBox(): bool { foreach ($this->items as $item) { - if ($item->product->getTypeInstance()->showQuantityBox() === true) { + if ($item->product->getTypeInstance() + ->showQuantityBox() === true) { return true; } } @@ -158,7 +174,7 @@ public function hasProductsWithQuantityBox(): bool * * @return boolean */ - public function hasGuestCheckoutItems() + public function hasGuestCheckoutItems(): bool { foreach ($this->items as $item) { if ($item->product->getAttribute('guest_checkout') === 0) { @@ -176,10 +192,21 @@ public function hasGuestCheckoutItems() */ public function checkMinimumOrder(): bool { - $minimumOrderAmount = (float) core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0; + $minimumOrderAmount = (float)(core()->getConfigData('sales.orderSettings.minimum-order.minimum_order_amount') ?? 0); - $cartBaseSubTotal = (float) $this->base_sub_total; + $cartBaseSubTotal = (float)$this->base_sub_total; return $cartBaseSubTotal >= $minimumOrderAmount; } + + + /** + * Create a new factory instance for the model + * + * @return CartFactory + */ + protected static function newFactory(): CartFactory + { + return CartFactory::new(); + } } diff --git a/packages/Webkul/Checkout/src/Models/CartAddress.php b/packages/Webkul/Checkout/src/Models/CartAddress.php index 88cb4ec298e..c7b26bf47b6 100755 --- a/packages/Webkul/Checkout/src/Models/CartAddress.php +++ b/packages/Webkul/Checkout/src/Models/CartAddress.php @@ -3,20 +3,28 @@ namespace Webkul\Checkout\Models; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Checkout\Database\Factories\CartAddressFactory; use Webkul\Checkout\Contracts\CartAddress as CartAddressContract; use Webkul\Core\Models\Address; /** * Class CartAddress + * * @package Webkul\Checkout\Models * * @property integer $cart_id - * @property Cart $cart + * @property Cart $cart * */ class CartAddress extends Address implements CartAddressContract { + use HasFactory; + public const ADDRESS_TYPE_SHIPPING = 'cart_shipping'; + public const ADDRESS_TYPE_BILLING = 'cart_billing'; /** @@ -31,12 +39,12 @@ class CartAddress extends Address implements CartAddressContract * * @return void */ - protected static function boot() + protected static function boot(): void { static::addGlobalScope('address_type', static function (Builder $builder) { $builder->whereIn('address_type', [ self::ADDRESS_TYPE_BILLING, - self::ADDRESS_TYPE_SHIPPING + self::ADDRESS_TYPE_SHIPPING, ]); }); @@ -46,7 +54,7 @@ protected static function boot() /** * Get the shipping rates for the cart address. */ - public function shipping_rates() + public function shipping_rates(): HasMany { return $this->hasMany(CartShippingRateProxy::modelClass()); } @@ -54,8 +62,18 @@ public function shipping_rates() /** * Get the cart record associated with the address. */ - public function cart() + public function cart(): BelongsTo { return $this->belongsTo(Cart::class); } + + /** + * Create a new factory instance for the model + * + * @return CartAddressFactory + */ + protected static function newFactory(): CartAddressFactory + { + return CartAddressFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Checkout/src/Models/CartItem.php b/packages/Webkul/Checkout/src/Models/CartItem.php index 561b85c6405..f2da97ccbf6 100755 --- a/packages/Webkul/Checkout/src/Models/CartItem.php +++ b/packages/Webkul/Checkout/src/Models/CartItem.php @@ -5,11 +5,18 @@ use Illuminate\Database\Eloquent\Model; use Webkul\Product\Models\ProductProxy; use Webkul\Product\Models\ProductFlatProxy; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Checkout\Database\Factories\CartItemFactory; use Webkul\Checkout\Contracts\CartItem as CartItemContract; class CartItem extends Model implements CartItemContract { + use HasFactory; + protected $table = 'cart_items'; protected $casts = [ @@ -22,7 +29,7 @@ class CartItem extends Model implements CartItemContract 'updated_at', ]; - public function product() + public function product(): HasOne { return $this->hasOne(ProductProxy::modelClass(), 'id', 'product_id'); } @@ -32,22 +39,22 @@ public function product() */ public function product_flat() { - return (ProductFlatProxy::modelClass()) - ::where('product_flat.product_id', $this->product_id) - ->where('product_flat.locale', app()->getLocale()) - ->where('product_flat.channel', core()->getCurrentChannelCode()) - ->select('product_flat.*'); + return (ProductFlatProxy::modelClass())::where('product_flat.product_id', $this->product_id) + ->where('product_flat.locale', app()->getLocale()) + ->where('product_flat.channel', core()->getCurrentChannelCode()) + ->select('product_flat.*'); } /** - * Get all of the attributes for the attribute groups. + * Get all the attributes for the attribute groups. */ public function getProductFlatAttribute() { - return $this->product_flat()->first(); + return $this->product_flat() + ->first(); } - public function cart() + public function cart(): HasOne { return $this->hasOne(CartProxy::modelClass(), 'id', 'cart_id'); } @@ -55,7 +62,7 @@ public function cart() /** * Get the child item. */ - public function child() + public function child(): BelongsTo { return $this->belongsTo(static::class, 'id', 'parent_id'); } @@ -63,7 +70,7 @@ public function child() /** * Get the parent item record associated with the cart item. */ - public function parent() + public function parent(): BelongsTo { return $this->belongsTo(self::class, 'parent_id'); } @@ -71,8 +78,18 @@ public function parent() /** * Get the children items. */ - public function children() + public function children(): HasMany { return $this->hasMany(self::class, 'parent_id'); } + + /** + * Create a new factory instance for the model + * + * @return CartItemFactory + */ + protected static function newFactory(): CartItemFactory + { + return CartItemFactory::new(); + } } diff --git a/packages/Webkul/Checkout/src/Models/CartPayment.php b/packages/Webkul/Checkout/src/Models/CartPayment.php index 76eec136f3a..f518fed58f0 100755 --- a/packages/Webkul/Checkout/src/Models/CartPayment.php +++ b/packages/Webkul/Checkout/src/Models/CartPayment.php @@ -3,9 +3,23 @@ namespace Webkul\Checkout\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Checkout\Database\Factories\CartPaymentFactory; use Webkul\Checkout\Contracts\CartPayment as CartPaymentContract; class CartPayment extends Model implements CartPaymentContract { + use HasFactory; + protected $table = 'cart_payment'; + + /** + * Create a new factory instance for the model + * + * @return CartPaymentFactory + */ + protected static function newFactory(): CartPaymentFactory + { + return CartPaymentFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Checkout/src/Providers/CheckoutServiceProvider.php b/packages/Webkul/Checkout/src/Providers/CheckoutServiceProvider.php index b0714c511e8..011765ec686 100755 --- a/packages/Webkul/Checkout/src/Providers/CheckoutServiceProvider.php +++ b/packages/Webkul/Checkout/src/Providers/CheckoutServiceProvider.php @@ -5,11 +5,10 @@ use Illuminate\Support\ServiceProvider; use Illuminate\Foundation\AliasLoader; use Webkul\Checkout\Facades\Cart; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; class CheckoutServiceProvider extends ServiceProvider { - public function boot() + public function boot(): void { include __DIR__ . '/../Http/helpers.php'; @@ -18,8 +17,6 @@ public function boot() $this->app->register(ModuleServiceProvider::class); $this->app->register(EventServiceProvider::class); - - $this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories'); } /** @@ -27,7 +24,7 @@ public function boot() * * @return void */ - public function register() + public function register(): void { $this->registerFacades(); } @@ -37,7 +34,7 @@ public function register() * * @return void */ - protected function registerFacades() + protected function registerFacades(): void { //to make the cart facade and bind the //alias to the class needed to be called. @@ -51,16 +48,4 @@ protected function registerFacades() $this->app->bind('cart', 'Webkul\Checkout\Cart'); } - - /** - * Register factories. - * - * @param string $path - * - * @return void - */ - protected function registerEloquentFactoriesFrom($path): void - { - $this->app->make(EloquentFactory::class)->load($path); - } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php index 49d6164780a..41f8b006207 100755 --- a/packages/Webkul/Core/src/Core.php +++ b/packages/Webkul/Core/src/Core.php @@ -145,7 +145,7 @@ public function getAllChannels() } /** - * Returns currenct channel models. + * Returns current channel models. * * @return \Webkul\Core\Contracts\Channel */ diff --git a/packages/Webkul/Core/src/Database/Factories/CartRuleCouponFactory.php b/packages/Webkul/Core/src/Database/Factories/CartRuleCouponFactory.php index f51b437ccab..003106a003e 100644 --- a/packages/Webkul/Core/src/Database/Factories/CartRuleCouponFactory.php +++ b/packages/Webkul/Core/src/Database/Factories/CartRuleCouponFactory.php @@ -1,20 +1,35 @@ define(CartRuleCoupon::class, function (Faker $faker) { - return [ - 'code' => $faker->uuid(), - 'usage_limit' => 100, - 'usage_per_customer' => 100, - 'type' => 0, - 'is_primary' => 1, - 'cart_rule_id' => static function () { - return factory(CartRule::class)->create()->id; - }, - ]; -}); +class CartRuleCouponFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = CartRuleCoupon::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'code' => Str::uuid(), + 'usage_limit' => 100, + 'usage_per_customer' => 100, + 'type' => 0, + 'is_primary' => 1, + 'cart_rule_id' => CartRule::factory(), + ]; + } +} diff --git a/packages/Webkul/Core/src/Database/Factories/CartRuleFactory.php b/packages/Webkul/Core/src/Database/Factories/CartRuleFactory.php index 330c3caa689..371d5a666af 100644 --- a/packages/Webkul/Core/src/Database/Factories/CartRuleFactory.php +++ b/packages/Webkul/Core/src/Database/Factories/CartRuleFactory.php @@ -1,30 +1,47 @@ define(CartRule::class, function (Faker $faker) { - return [ - 'name' => $faker->uuid, - 'description' => $faker->sentence(), - 'starts_from' => null, - 'ends_till' => null, - 'coupon_type' => '1', - 'use_auto_generation' => '0', - 'usage_per_customer' => '100', - 'uses_per_coupon' => '100', - 'times_used' => '0', - 'condition_type' => '2', - 'end_other_rules' => '0', - 'uses_attribute_conditions' => '0', - 'discount_quantity' => '0', - 'discount_step' => '0', - 'apply_to_shipping' => '0', - 'free_shipping' => '0', - 'sort_order' => '0', - 'status' => '1', - 'conditions' => null, - ]; -}); \ No newline at end of file +class CartRuleFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = CartRule::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => Str::uuid(), + 'description' => $this->faker->sentence(), + 'starts_from' => null, + 'ends_till' => null, + 'coupon_type' => '1', + 'use_auto_generation' => '0', + 'usage_per_customer' => '100', + 'uses_per_coupon' => '100', + 'times_used' => '0', + 'condition_type' => '2', + 'end_other_rules' => '0', + 'uses_attribute_conditions' => '0', + 'discount_quantity' => '0', + 'discount_step' => '0', + 'apply_to_shipping' => '0', + 'free_shipping' => '0', + 'sort_order' => '0', + 'status' => '1', + 'conditions' => null, + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Factories/ChannelFactory.php b/packages/Webkul/Core/src/Database/Factories/ChannelFactory.php index 80f04d97696..8df7f7b7204 100644 --- a/packages/Webkul/Core/src/Database/Factories/ChannelFactory.php +++ b/packages/Webkul/Core/src/Database/Factories/ChannelFactory.php @@ -1,39 +1,48 @@ define(Channel::class, function (Faker $faker, array $attributes) { - - $seoTitle = $attributes['seo_title'] ?? $faker->word; - $seoDescription = $attributes['seo_description'] ?? $faker->words(10, true); - $seoKeywords = $attributes['seo_keywords'] ?? $faker->words(3, true); - - $seoData = [ - 'meta_title' => $seoTitle, - 'meta_description' => $seoDescription, - 'meta_keywords' => $seoKeywords, - ]; +class ChannelFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Channel::class; - unset($attributes['seo_title'], $attributes['seo_description'], $attributes['seo_keywords']); + /** + * Define the model's default state. + * + * @return array + * @throws \JsonException + */ + public function definition(): array + { + $seoTitle = $this->faker->word; + $seoDescription = $this->faker->words(10, true); + $seoKeywords = $this->faker->words(3, true); + $seoData = [ + 'meta_title' => $seoTitle, + 'meta_description' => $seoDescription, + 'meta_keywords' => $seoKeywords, + ]; - return [ - 'code' => $faker->unique()->word, - 'name' => $faker->word, - 'default_locale_id' => function () { - return factory(Locale::class)->create()->id; - }, - 'base_currency_id' => function () { - return factory(Currency::class)->create()->id; - }, - 'root_category_id' => function () { - return factory(Category::class)->create()->id; - }, - 'home_seo' => json_encode($seoData), - ]; -}); + return [ + 'code' => $this->faker->unique()->word, + 'name' => $this->faker->word, + 'default_locale_id' => Locale::factory(), + 'base_currency_id' => Currency::factory(), + 'root_category_id' => Category::factory(), + 'home_seo' => json_encode($seoData, JSON_THROW_ON_ERROR), + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Factories/ChannelInventorySourceFactory.php b/packages/Webkul/Core/src/Database/Factories/ChannelInventorySourceFactory.php index 4b8c272c580..c8e8e0f57f2 100644 --- a/packages/Webkul/Core/src/Database/Factories/ChannelInventorySourceFactory.php +++ b/packages/Webkul/Core/src/Database/Factories/ChannelInventorySourceFactory.php @@ -1,10 +1,28 @@ define('channel_inventory_sources', function () { - return [ - 'channel_id' => core()->getCurrentChannel()->id, - 'inventory_source_id' => 1, - ]; -}); \ No newline at end of file +namespace Webkul\Core\Database\Factories; + +use Illuminate\Database\Eloquent\Factories\Factory; + +class ChannelInventorySourceFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = 'channel_inventory_sources'; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'channel_id' => core()->getCurrentChannel()->id, + 'inventory_source_id' => 1, + ]; + } +} diff --git a/packages/Webkul/Core/src/Database/Factories/CurrencyFactory.php b/packages/Webkul/Core/src/Database/Factories/CurrencyFactory.php index 2b551eae9eb..73bfc2c59bb 100644 --- a/packages/Webkul/Core/src/Database/Factories/CurrencyFactory.php +++ b/packages/Webkul/Core/src/Database/Factories/CurrencyFactory.php @@ -1,14 +1,30 @@ define(Currency::class, function (Faker $faker, array $attributes) { - - return [ - 'code' => $faker->unique()->currencyCode, - 'name' => $faker->word, - ]; +class CurrencyFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Currency::class; -}); \ No newline at end of file + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'code' => $this->faker->unique()->currencyCode, + 'name' => $this->faker->word, + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Factories/LocaleFactory.php b/packages/Webkul/Core/src/Database/Factories/LocaleFactory.php index 69628675e9a..c612d6054b6 100644 --- a/packages/Webkul/Core/src/Database/Factories/LocaleFactory.php +++ b/packages/Webkul/Core/src/Database/Factories/LocaleFactory.php @@ -1,22 +1,52 @@ define(Locale::class, function (Faker $faker, array $attributes) { +use Webkul\Core\Models\Locale; +use Illuminate\Database\Eloquent\Factories\Factory; - do { - $languageCode = $faker->languageCode; - } while (Locale::query()->where('code', $languageCode)->exists()); +class LocaleFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Locale::class; - return [ - 'code' => $languageCode, - 'name' => $faker->country, - 'direction' => 'ltr', + /** + * @var string[] + */ + protected $states = [ + 'rtl', ]; -}); -$factory->state(Category::class, 'rtl', [ - 'direction' => 'rtl', -]); \ No newline at end of file + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + do { + $languageCode = $this->faker->languageCode; + } while (Locale::query() + ->where('code', $languageCode) + ->exists()); + + return [ + 'code' => $languageCode, + 'name' => $this->faker->country, + 'direction' => 'ltr', + ]; + } + + public function rtl(): LocaleFactory + { + return $this->state(function (array $attributes) { + return [ + 'direction' => 'rtl', + ]; + }); + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Factories/SubscriberListFactory.php b/packages/Webkul/Core/src/Database/Factories/SubscriberListFactory.php index 947e8cf2ec4..5aab67eb7a6 100644 --- a/packages/Webkul/Core/src/Database/Factories/SubscriberListFactory.php +++ b/packages/Webkul/Core/src/Database/Factories/SubscriberListFactory.php @@ -1,14 +1,31 @@ $this->faker->safeEmail, + 'is_subscribed' => $this->faker->boolean, + 'channel_id' => 1, + ]; + } +} -$factory->define(SubscribersList::class, function (Faker $faker) { - return [ - 'email' => $faker->safeEmail, - 'is_subscribed' => $faker->boolean, - 'channel_id' => 1, - ]; -}); diff --git a/packages/Webkul/Core/src/Helpers/Laravel5Helper.php b/packages/Webkul/Core/src/Helpers/Laravel5Helper.php index 028f7ab01a3..ad80203e98a 100644 --- a/packages/Webkul/Core/src/Helpers/Laravel5Helper.php +++ b/packages/Webkul/Core/src/Helpers/Laravel5Helper.php @@ -7,7 +7,7 @@ use StdClass; use Faker\Factory; -use Codeception\Module\Laravel5; +use Codeception\Module\Laravel; use Webkul\Checkout\Models\Cart; use Webkul\Product\Models\Product; use Illuminate\Support\Facades\DB; @@ -30,18 +30,21 @@ * * @package Webkul\Core\Helpers */ -class Laravel5Helper extends Laravel5 +class Laravel5Helper extends Laravel { public const SIMPLE_PRODUCT = 1; + public const VIRTUAL_PRODUCT = 2; + public const DOWNLOADABLE_PRODUCT = 3; + public const BOOKING_EVENT_PRODUCT = 4; /** * Returns the field name of the given attribute in which a value should be saved inside * the 'product_attribute_values' table. Depends on the type. * - * @param string $type + * @param string $type * * @return string|null * @part ORM @@ -146,7 +149,7 @@ public function prepareCart(array $options = []): array /** * Set all session with the given key and value in the array. * - * @param array $keyValue + * @param array $keyValue */ public function setSession(array $keyValue): void { @@ -169,9 +172,9 @@ public function invalidateSession(): void * By default, the product will be generated as saleable, this means it has a price, * weight, is active and has a positive inventory stock, if necessary. * - * @param int $productType see constants in this class for usage - * @param array $configs - * @param array $productStates + * @param int $productType see constants in this class for usage + * @param array $configs + * @param array $productStates * * @return \Webkul\Product\Models\Product * @part ORM @@ -271,7 +274,13 @@ private function haveBookingEventProduct(array $configs = [], array $productStat private function createProduct(array $attributes = [], array $states = []): Product { - return factory(Product::class)->states($states)->create($attributes); + return Product::factory() + ->state(function () use ($states) { + return [ + 'type' => $states[0], + ]; + }) + ->create($attributes); } private function createInventory(int $productId, array $inventoryConfig = []): void @@ -314,17 +323,16 @@ private function createAttributeValues(Product $product, array $attributeValues $faker = Factory::create(); $brand = Attribute::query() - ->where(['code' => 'brand']) - ->firstOrFail(); // usually 25 + ->where(['code' => 'brand']) + ->firstOrFail(); // usually 25 - if (! AttributeOption::query() - ->where(['attribute_id' => $brand->id]) - ->exists()) { + if (!AttributeOption::query() + ->where(['attribute_id' => $brand->id]) + ->exists()) { AttributeOption::create([ 'admin_name' => 'Webkul Demo Brand (c) 2020', 'attribute_id' => $brand->id, ]); - } /** @@ -345,17 +353,19 @@ private function createAttributeValues(Product $product, array $attributeValues 'special_price_to' => null, 'special_price' => null, 'price' => $faker->randomFloat(2, 1, 1000), - 'weight' => '1.00', // necessary for shipping - 'brand' => AttributeOption::query()->firstWhere('attribute_id', $brand->id)->id, + 'weight' => '1.00', + // necessary for shipping + 'brand' => AttributeOption::query() + ->firstWhere('attribute_id', $brand->id)->id, ]; $attributeValues = array_merge($defaultAttributeValues, $attributeValues); /** @var array $possibleAttributeValues list of the possible attributes a product can have */ $possibleAttributeValues = DB::table('attributes') - ->select('id', 'code', 'type') - ->get() - ->toArray(); + ->select('id', 'code', 'type') + ->get() + ->toArray(); foreach ($possibleAttributeValues as $attributeSet) { $data = [ @@ -374,8 +384,8 @@ private function createAttributeValues(Product $product, array $attributeValues } /** - * @param string $attributeCode - * @param array $data + * @param string $attributeCode + * @param array $data * * @return array */ @@ -389,7 +399,7 @@ private function appendAttributeDependencies(string $attributeCode, array $data) 'locale', 'channel', ], - 'tax_category_id' => [ + 'tax_category_id' => [ 'channel', ], 'short_description' => [ @@ -440,5 +450,4 @@ private function appendAttributeDependencies(string $attributeCode, array $data) return $data; } - } diff --git a/packages/Webkul/Core/src/Models/Address.php b/packages/Webkul/Core/src/Models/Address.php index f6627933233..d0bb8e5e3c9 100644 --- a/packages/Webkul/Core/src/Models/Address.php +++ b/packages/Webkul/Core/src/Models/Address.php @@ -1,9 +1,7 @@ 'array', + 'additional' => 'array', 'default_address' => 'boolean', ]; /** - * Get all of the attributes for the attribute groups. + * Get all the attributes for the attribute groups. */ public function getNameAttribute(): string { diff --git a/packages/Webkul/Core/src/Models/Channel.php b/packages/Webkul/Core/src/Models/Channel.php index 45741f1237e..8a721795597 100755 --- a/packages/Webkul/Core/src/Models/Channel.php +++ b/packages/Webkul/Core/src/Models/Channel.php @@ -6,10 +6,16 @@ use Webkul\Category\Models\CategoryProxy; use Webkul\Core\Eloquent\TranslatableModel; use Webkul\Inventory\Models\InventorySourceProxy; +use Webkul\Core\Database\Factories\ChannelFactory; use Webkul\Core\Contracts\Channel as ChannelContract; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; class Channel extends TranslatableModel implements ChannelContract { + use HasFactory; + protected $fillable = [ 'code', 'name', @@ -24,7 +30,7 @@ class Channel extends TranslatableModel implements ChannelContract 'home_seo', 'is_maintenance_on', 'maintenance_mode_text', - 'allowed_ips' + 'allowed_ips', ]; public $translatedAttributes = [ @@ -39,7 +45,7 @@ class Channel extends TranslatableModel implements ChannelContract /** * Get the channel locales. */ - public function locales() + public function locales(): BelongsToMany { return $this->belongsToMany(LocaleProxy::modelClass(), 'channel_locales'); } @@ -47,7 +53,7 @@ public function locales() /** * Get the default locale */ - public function default_locale() + public function default_locale(): BelongsTo { return $this->belongsTo(LocaleProxy::modelClass()); } @@ -55,7 +61,7 @@ public function default_locale() /** * Get the channel locales. */ - public function currencies() + public function currencies(): BelongsToMany { return $this->belongsToMany(CurrencyProxy::modelClass(), 'channel_currencies'); } @@ -63,7 +69,7 @@ public function currencies() /** * Get the channel inventory sources. */ - public function inventory_sources() + public function inventory_sources(): BelongsToMany { return $this->belongsToMany(InventorySourceProxy::modelClass(), 'channel_inventory_sources'); } @@ -71,7 +77,7 @@ public function inventory_sources() /** * Get the base currency */ - public function base_currency() + public function base_currency(): BelongsTo { return $this->belongsTo(CurrencyProxy::modelClass()); } @@ -79,7 +85,7 @@ public function base_currency() /** * Get the base currency */ - public function root_category() + public function root_category(): BelongsTo { return $this->belongsTo(CategoryProxy::modelClass(), 'root_category_id'); } @@ -123,4 +129,14 @@ public function getFaviconUrlAttribute() { return $this->favicon_url(); } + + /** + * Create a new factory instance for the model + * + * @return ChannelFactory + */ + protected static function newFactory(): ChannelFactory + { + return ChannelFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Models/Currency.php b/packages/Webkul/Core/src/Models/Currency.php index 7fc11b6d7e1..1e3db0e9dc7 100755 --- a/packages/Webkul/Core/src/Models/Currency.php +++ b/packages/Webkul/Core/src/Models/Currency.php @@ -3,10 +3,15 @@ namespace Webkul\Core\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Webkul\Core\Database\Factories\CurrencyFactory; use Webkul\Core\Contracts\Currency as CurrencyContract; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Currency extends Model implements CurrencyContract { + use HasFactory; + /** * The attributes that are mass assignable. * @@ -21,10 +26,11 @@ class Currency extends Model implements CurrencyContract /** * Set currency code in capital * - * @param string $value + * @param $code + * * @return void */ - public function setCodeAttribute($code) + public function setCodeAttribute($code): void { $this->attributes['code'] = strtoupper($code); } @@ -32,8 +38,18 @@ public function setCodeAttribute($code) /** * Get the exchange rate associated with the currency. */ - public function exchange_rate() + public function exchange_rate(): HasOne { return $this->hasOne(CurrencyExchangeRateProxy::modelClass(), 'target_currency'); } + + /** + * Create a new factory instance for the model. + * + * @return CurrencyFactory + */ + protected static function newFactory(): CurrencyFactory + { + return CurrencyFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Models/Locale.php b/packages/Webkul/Core/src/Models/Locale.php index 79e6a879d6b..7814bdd94fe 100755 --- a/packages/Webkul/Core/src/Models/Locale.php +++ b/packages/Webkul/Core/src/Models/Locale.php @@ -3,10 +3,14 @@ namespace Webkul\Core\Models; use Illuminate\Database\Eloquent\Model; +use Webkul\Core\Database\Factories\LocaleFactory; use Webkul\Core\Contracts\Locale as LocaleContract; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Locale extends Model implements LocaleContract { + use HasFactory; + /** * The attributes that are mass assignable. * @@ -17,4 +21,14 @@ class Locale extends Model implements LocaleContract 'name', 'direction', ]; + + /** + * Create a new factory instance for the model. + * + * @return LocaleFactory + */ + protected static function newFactory(): LocaleFactory + { + return LocaleFactory::new(); + } } diff --git a/packages/Webkul/Core/src/Models/SubscribersList.php b/packages/Webkul/Core/src/Models/SubscribersList.php index d016047f0dc..2cbbb7ef8f2 100755 --- a/packages/Webkul/Core/src/Models/SubscribersList.php +++ b/packages/Webkul/Core/src/Models/SubscribersList.php @@ -4,10 +4,15 @@ use Illuminate\Database\Eloquent\Model; use Webkul\Customer\Models\CustomerProxy; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Core\Database\Factories\SubscriberListFactory; use Webkul\Core\Contracts\SubscribersList as SubscribersListContract; class SubscribersList extends Model implements SubscribersListContract { + use HasFactory; + /** * The attributes that are mass assignable. * @@ -29,8 +34,18 @@ class SubscribersList extends Model implements SubscribersListContract /** * Get the customer associated with the subscription. */ - public function customer() + public function customer(): BelongsTo { return $this->belongsTo(CustomerProxy::modelClass()); } + + /** + * Create a new factory instance for the model. + * + * @return SubscriberListFactory + */ + protected static function newFactory(): SubscriberListFactory + { + return SubscriberListFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Providers/CoreModuleServiceProvider.php b/packages/Webkul/Core/src/Providers/CoreModuleServiceProvider.php index fa30ba04018..a366f4b29db 100644 --- a/packages/Webkul/Core/src/Providers/CoreModuleServiceProvider.php +++ b/packages/Webkul/Core/src/Providers/CoreModuleServiceProvider.php @@ -6,7 +6,7 @@ class CoreModuleServiceProvider extends BaseModuleServiceProvider { - public function boot() + public function boot(): void { if ($this->areMigrationsEnabled()) { $this->registerMigrations(); diff --git a/packages/Webkul/Core/src/Providers/CoreServiceProvider.php b/packages/Webkul/Core/src/Providers/CoreServiceProvider.php index d47c9bf539f..f6c961d3a97 100755 --- a/packages/Webkul/Core/src/Providers/CoreServiceProvider.php +++ b/packages/Webkul/Core/src/Providers/CoreServiceProvider.php @@ -3,7 +3,6 @@ namespace Webkul\Core\Providers; use Illuminate\Contracts\Debug\ExceptionHandler; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Foundation\AliasLoader; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Validator; @@ -22,16 +21,13 @@ class CoreServiceProvider extends ServiceProvider * Bootstrap services. * * @return void - * @throws \Illuminate\Contracts\Container\BindingResolutionException */ - public function boot() + public function boot(): void { include __DIR__ . '/../Http/helpers.php'; $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); - $this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories'); - $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'core'); Validator::extend('slug', 'Webkul\Core\Contracts\Validations\Slug@passes'); @@ -42,13 +38,10 @@ public function boot() $this->publishes([ dirname(__DIR__) . '/Config/concord.php' => config_path('concord.php'), - dirname(__DIR__) . '/Config/scout.php' => config_path('scout.php'), + dirname(__DIR__) . '/Config/scout.php' => config_path('scout.php'), ]); - $this->app->bind( - ExceptionHandler::class, - Handler::class - ); + $this->app->bind(ExceptionHandler::class, Handler::class); SliderProxy::observe(SliderObserver::class); @@ -76,7 +69,7 @@ public function boot() * * @return void */ - public function register() + public function register(): void { $this->registerFacades(); @@ -90,7 +83,7 @@ public function register() * * @return void */ - protected function registerFacades() + protected function registerFacades(): void { $loader = AliasLoader::getInstance(); $loader->alias('core', CoreFacade::class); @@ -122,24 +115,12 @@ protected function registerCommands(): void ]); } - /** - * Register factories. - * - * @param string $path - * @return void - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function registerEloquentFactoriesFrom($path): void - { - $this->app->make(EloquentFactory::class)->load($path); - } - /** * Register the Blade compiler implementation. * * @return void */ - public function registerBladeCompiler() + public function registerBladeCompiler(): void { $this->app->singleton('blade.compiler', function ($app) { return new BladeCompiler($app['files'], $app['config']['view.compiled']); diff --git a/packages/Webkul/Customer/src/Database/Factories/CustomerAddressFactory.php b/packages/Webkul/Customer/src/Database/Factories/CustomerAddressFactory.php index 1aae97cd8fb..4c0f3875c53 100644 --- a/packages/Webkul/Customer/src/Database/Factories/CustomerAddressFactory.php +++ b/packages/Webkul/Customer/src/Database/Factories/CustomerAddressFactory.php @@ -1,34 +1,52 @@ Customer::factory(), + 'company_name' => $this->faker->company, + 'vat_id' => $fakerIt->vatId(), + 'first_name' => $this->faker->firstName, + 'last_name' => $this->faker->lastName, + 'address1' => $this->faker->streetAddress, + 'country' => $this->faker->countryCode, + 'state' => $this->faker->state, + 'city' => $this->faker->city, + 'postcode' => $this->faker->postcode, + 'phone' => $this->faker->e164PhoneNumber, + 'default_address' => Arr::random([ + 0, + 1, + ]), + 'address_type' => CustomerAddress::ADDRESS_TYPE, + ]; + } +} -$factory->define(CustomerAddress::class, function (Faker $faker) { - // use an locale from a country in europe so the vat id can be generated - $fakerIt = \Faker\Factory::create('it_IT'); - - return [ - 'customer_id' => function () { - return factory(Customer::class)->create()->id; - }, - 'company_name' => $faker->company, - 'vat_id' => $fakerIt->vatId(), - 'first_name' => $faker->firstName, - 'last_name' => $faker->lastName, - 'address1' => $faker->streetAddress, - 'country' => $faker->countryCode, - 'state' => $faker->state, - 'city' => $faker->city, - 'postcode' => $faker->postcode, - 'phone' => $faker->e164PhoneNumber, - 'default_address' => Arr::random([0, 1]), - 'address_type' => CustomerAddress::ADDRESS_TYPE, - ]; -}); diff --git a/packages/Webkul/Customer/src/Database/Factories/CustomerFactory.php b/packages/Webkul/Customer/src/Database/Factories/CustomerFactory.php index 28789f7ef19..626889829fc 100644 --- a/packages/Webkul/Customer/src/Database/Factories/CustomerFactory.php +++ b/packages/Webkul/Customer/src/Database/Factories/CustomerFactory.php @@ -1,35 +1,74 @@ define(Customer::class, function (Faker $faker) { - $now = date("Y-m-d H:i:s"); - $password = $faker->password; - - return [ - 'first_name' => $faker->firstName(), - 'last_name' => $faker->lastName, - 'gender' => Arr::random(['male', 'female', 'other']), - 'email' => $faker->email, - 'status' => 1, - 'password' => Hash::make($password), - 'customer_group_id' => 2, - 'is_verified' => 1, - 'created_at' => $now, - 'updated_at' => $now, - 'notes' => json_encode(['plain_password' => $password]), +class CustomerFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Customer::class; + + /** + * @var array + */ + protected $states = [ + 'male', + 'female', ]; -}); -$factory->state(Customer::class, 'male', [ - 'gender' => 'Male', -]); + /** + * Define the model's default state. + * + * @return array + * @throws \Exception + */ + public function definition(): array + { + $now = date("Y-m-d H:i:s"); + $password = $this->faker->password; + + return [ + 'first_name' => $this->faker->firstName(), + 'last_name' => $this->faker->lastName, + 'gender' => Arr::random([ + 'male', + 'female', + 'other', + ]), + 'email' => $this->faker->email, + 'status' => 1, + 'password' => Hash::make($password), + 'customer_group_id' => 2, + 'is_verified' => 1, + 'created_at' => $now, + 'updated_at' => $now, + 'notes' => json_encode(['plain_password' => $password], JSON_THROW_ON_ERROR), + ]; + } + + public function male(): CustomerFactory + { + return $this->state(function (array $attributes) { + return [ + 'gender' => 'Male', + ]; + }); + } -$factory->state(Customer::class, 'female', [ - 'gender' => 'Female', -]); + public function female(): CustomerFactory + { + return $this->state(function (array $attributes) { + return [ + 'gender' => 'Female', + ]; + }); + } +} diff --git a/packages/Webkul/Customer/src/Database/Factories/CustomerGroupFactory.php b/packages/Webkul/Customer/src/Database/Factories/CustomerGroupFactory.php index ccc77cb331a..f0c0eb1b9a1 100644 --- a/packages/Webkul/Customer/src/Database/Factories/CustomerGroupFactory.php +++ b/packages/Webkul/Customer/src/Database/Factories/CustomerGroupFactory.php @@ -1,16 +1,33 @@ define(CustomerGroup::class, function (Faker $faker) { - $name = ucfirst($faker->word); - - return [ - 'name' => $name, - 'is_user_defined' => $faker->boolean, - 'code' => lcfirst($name), - ]; -}); +class CustomerGroupFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = CustomerGroup::class; + + /** + * Define the model's default state. + * + * @return array + * @throws \Exception + */ + public function definition(): array + { + $name = ucfirst($this->faker->word); + + return [ + 'name' => $name, + 'is_user_defined' => $this->faker->boolean, + 'code' => lcfirst($name), + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Customer/src/Models/Customer.php b/packages/Webkul/Customer/src/Models/Customer.php index 12a3a3283e5..e06f18e667b 100755 --- a/packages/Webkul/Customer/src/Models/Customer.php +++ b/packages/Webkul/Customer/src/Models/Customer.php @@ -3,18 +3,24 @@ namespace Webkul\Customer\Models; use Illuminate\Notifications\Notifiable; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Foundation\Auth\User as Authenticatable; use Tymon\JWTAuth\Contracts\JWTSubject; use Webkul\Checkout\Models\CartProxy; use Webkul\Sales\Models\OrderProxy; use Webkul\Core\Models\SubscribersListProxy; use Webkul\Product\Models\ProductReviewProxy; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Customer\Database\Factories\CustomerFactory; use Webkul\Customer\Notifications\CustomerResetPassword; use Webkul\Customer\Contracts\Customer as CustomerContract; +use Webkul\Customer\Database\Factories\CustomerAddressFactory; class Customer extends Authenticatable implements CustomerContract, JWTSubject { - use Notifiable; + use Notifiable, HasFactory; protected $table = 'customers'; @@ -35,12 +41,16 @@ class Customer extends Authenticatable implements CustomerContract, JWTSubject 'status', ]; - protected $hidden = ['password', 'api_token', 'remember_token']; + protected $hidden = [ + 'password', + 'api_token', + 'remember_token', + ]; /** * Get the customer full name. */ - public function getNameAttribute() + public function getNameAttribute(): string { return ucfirst($this->first_name) . ' ' . ucfirst($this->last_name); } @@ -48,32 +58,33 @@ public function getNameAttribute() /** * Email exists or not */ - public function emailExists($email) + public function emailExists($email): bool { - $results = $this->where('email', $email); + $results = $this->where('email', $email); - if ($results->count() == 0) { + if ($results->count() === 0) { return false; - } else { - return true; } + + return true; } /** * Get the customer group that owns the customer. */ - public function group() + public function group(): BelongsTo { return $this->belongsTo(CustomerGroupProxy::modelClass(), 'customer_group_id'); } /** - * Send the password reset notification. - * - * @param string $token - * @return void - */ - public function sendPasswordResetNotification($token) + * Send the password reset notification. + * + * @param string $token + * + * @return void + */ + public function sendPasswordResetNotification($token): void { $this->notify(new CustomerResetPassword($token)); } @@ -81,7 +92,7 @@ public function sendPasswordResetNotification($token) /** * Get the customer address that owns the customer. */ - public function addresses() + public function addresses(): HasMany { return $this->hasMany(CustomerAddressProxy::modelClass(), 'customer_id'); } @@ -89,15 +100,16 @@ public function addresses() /** * Get default customer address that owns the customer. */ - public function default_address() + public function default_address(): HasOne { - return $this->hasOne(CustomerAddressProxy::modelClass(), 'customer_id')->where('default_address', 1); + return $this->hasOne(CustomerAddressProxy::modelClass(), 'customer_id') + ->where('default_address', 1); } /** * Customer's relation with wishlist items */ - public function wishlist_items() + public function wishlist_items(): HasMany { return $this->hasMany(WishlistProxy::modelClass(), 'customer_id'); } @@ -105,31 +117,33 @@ public function wishlist_items() /** * get all cart inactive cart instance of a customer */ - public function all_carts() + public function all_carts(): HasMany { return $this->hasMany(CartProxy::modelClass(), 'customer_id'); } /** - * get inactive cart inactive cart instance of a customer + * get inactive cart instance of a customer */ - public function inactive_carts() + public function inactive_carts(): HasMany { - return $this->hasMany(CartProxy::modelClass(), 'customer_id')->where('is_active', 0); + return $this->hasMany(CartProxy::modelClass(), 'customer_id') + ->where('is_active', 0); } /** * get active cart inactive cart instance of a customer */ - public function active_carts() + public function active_carts(): HasMany { - return $this->hasMany(CartProxy::modelClass(), 'customer_id')->where('is_active', 1); + return $this->hasMany(CartProxy::modelClass(), 'customer_id') + ->where('is_active', 1); } /** * get all reviews of a customer - */ - public function all_reviews() + */ + public function all_reviews(): HasMany { return $this->hasMany(ProductReviewProxy::modelClass(), 'customer_id'); } @@ -137,7 +151,7 @@ public function all_reviews() /** * get all orders of a customer */ - public function all_orders() + public function all_orders(): HasMany { return $this->hasMany(OrderProxy::modelClass(), 'customer_id'); } @@ -157,7 +171,7 @@ public function getJWTIdentifier() * * @return array */ - public function getJWTCustomClaims() + public function getJWTCustomClaims(): array { return []; } @@ -165,8 +179,18 @@ public function getJWTCustomClaims() /** * Get the customer's subscription. */ - public function subscription() + public function subscription(): HasOne { return $this->hasOne(SubscribersListProxy::modelClass(), 'customer_id'); } + + /** + * Create a new factory instance for the model + * + * @return CustomerFactory + */ + protected static function newFactory(): CustomerFactory + { + return CustomerFactory::new(); + } } diff --git a/packages/Webkul/Customer/src/Models/CustomerAddress.php b/packages/Webkul/Customer/src/Models/CustomerAddress.php index 89cecb4cbcf..e84eb6ee3f6 100755 --- a/packages/Webkul/Customer/src/Models/CustomerAddress.php +++ b/packages/Webkul/Customer/src/Models/CustomerAddress.php @@ -4,10 +4,14 @@ use Illuminate\Database\Eloquent\Builder; use Webkul\Core\Models\Address; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Customer\Database\Factories\CustomerAddressFactory; use Webkul\Customer\Contracts\CustomerAddress as CustomerAddressContract; class CustomerAddress extends Address implements CustomerAddressContract { + use HasFactory; + public const ADDRESS_TYPE = 'customer'; /** @@ -22,7 +26,7 @@ class CustomerAddress extends Address implements CustomerAddressContract * * @return void */ - protected static function boot() + protected static function boot(): void { static::addGlobalScope('address_type', static function (Builder $builder) { $builder->where('address_type', self::ADDRESS_TYPE); @@ -30,4 +34,14 @@ protected static function boot() parent::boot(); } + + /** + * Create a new factory instance for the model + * + * @return CustomerAddressFactory + */ + protected static function newFactory(): CustomerAddressFactory + { + return CustomerAddressFactory::new(); + } } diff --git a/packages/Webkul/Customer/src/Models/CustomerGroup.php b/packages/Webkul/Customer/src/Models/CustomerGroup.php index e8a546d5397..421e72dcd08 100755 --- a/packages/Webkul/Customer/src/Models/CustomerGroup.php +++ b/packages/Webkul/Customer/src/Models/CustomerGroup.php @@ -1,20 +1,40 @@ hasMany(CustomerProxy::modelClass()); } + + /** + * Create a new factory instance for the model + * + * @return CustomerGroupFactory + */ + protected static function newFactory(): CustomerGroupFactory + { + return CustomerGroupFactory::new(); + } } diff --git a/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php b/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php index a482df18850..28c31b54932 100755 --- a/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php +++ b/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php @@ -2,10 +2,10 @@ namespace Webkul\Customer\Providers; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Routing\Router; use Illuminate\Support\ServiceProvider; use Webkul\Customer\Captcha; +use Illuminate\Database\Eloquent\Factories\Factory; use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer; class CustomerServiceProvider extends ServiceProvider @@ -13,9 +13,10 @@ class CustomerServiceProvider extends ServiceProvider /** * Bootstrap application services. * + * @param \Illuminate\Routing\Router $router * @return void */ - public function boot(Router $router) + public function boot(Router $router): void { $router->aliasMiddleware('customer', RedirectIfNotCustomer::class); @@ -34,41 +35,23 @@ public function boot(Router $router) * Register services. * * @return void - * @throws \Illuminate\Contracts\Container\BindingResolutionException */ - public function register() + public function register(): void { $this->registerConfig(); - $this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories'); - $this->app->singleton('captcha', function ($app) { return new Captcha(); }); } - /** - * Register factories. - * - * @param string $path - * @return void - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function registerEloquentFactoriesFrom($path): void - { - $this->app->make(EloquentFactory::class)->load($path); - } - /** * Register package config. * * @return void */ - protected function registerConfig() + protected function registerConfig(): void { - $this->mergeConfigFrom( - dirname(__DIR__) . '/Config/system.php', - 'core' - ); + $this->mergeConfigFrom(dirname(__DIR__) . '/Config/system.php', 'core'); } } diff --git a/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php b/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php index feac8d1e9d1..0143ab0202d 100644 --- a/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php +++ b/packages/Webkul/Inventory/src/Database/Factories/InventorySourceFactory.php @@ -1,28 +1,44 @@ define(InventorySource::class, function (Faker $faker) { - $now = date("Y-m-d H:i:s"); - $code = $faker->unique()->word; - - return [ - 'code' => $faker->unique()->word, - 'name' => $code, - 'description' => $faker->sentence, - 'contact_name' => $faker->name, - 'contact_email' => $faker->safeEmail, - 'contact_number' => $faker->phoneNumber, - 'country' => $faker->countryCode, - 'state' => $faker->state, - 'city' => $faker->city, - 'street' => $faker->streetAddress, - 'postcode' => $faker->postcode, - 'priority' => 0, - 'status' => 1, - 'created_at' => $now, - 'updated_at' => $now, - ]; -}); \ No newline at end of file + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $now = date("Y-m-d H:i:s"); + $code = $this->faker->unique()->word; + return [ + 'code' => $this->faker->unique()->word, + 'name' => $code, + 'description' => $this->faker->sentence, + 'contact_name' => $this->faker->name, + 'contact_email' => $this->faker->safeEmail, + 'contact_number' => $this->faker->phoneNumber, + 'country' => $this->faker->countryCode, + 'state' => $this->faker->state, + 'city' => $this->faker->city, + 'street' => $this->faker->streetAddress, + 'postcode' => $this->faker->postcode, + 'priority' => 0, + 'status' => 1, + 'created_at' => $now, + 'updated_at' => $now, + ]; + } +} diff --git a/packages/Webkul/Inventory/src/Models/InventorySource.php b/packages/Webkul/Inventory/src/Models/InventorySource.php index 6ab8922ed15..05834f972f6 100755 --- a/packages/Webkul/Inventory/src/Models/InventorySource.php +++ b/packages/Webkul/Inventory/src/Models/InventorySource.php @@ -3,9 +3,23 @@ namespace Webkul\Inventory\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Inventory\Database\Factories\InventorySourceFactory; use Webkul\Inventory\Contracts\InventorySource as InventorySourceContract; class InventorySource extends Model implements InventorySourceContract { + use HasFactory; + protected $guarded = ['_token']; + + /** + * Create a new factory instance for the model. + * + * @return InventorySourceFactory + */ + protected static function newFactory(): InventorySourceFactory + { + return InventorySourceFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Inventory/src/Providers/InventoryServiceProvider.php b/packages/Webkul/Inventory/src/Providers/InventoryServiceProvider.php index 9a952099889..035fc1476f7 100755 --- a/packages/Webkul/Inventory/src/Providers/InventoryServiceProvider.php +++ b/packages/Webkul/Inventory/src/Providers/InventoryServiceProvider.php @@ -3,7 +3,6 @@ namespace Webkul\Inventory\Providers; use Illuminate\Support\ServiceProvider; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; class InventoryServiceProvider extends ServiceProvider { @@ -12,11 +11,9 @@ class InventoryServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); - - $this->app->make(EloquentFactory::class)->load(__DIR__ . '/../Database/Factories'); } /** @@ -24,7 +21,7 @@ public function boot() * * @return void */ - public function register() + public function register(): void { } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php index 432963515e7..67e4d0f0bdd 100644 --- a/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php +++ b/packages/Webkul/Product/src/Database/Factories/ProductAttributeValueFactory.php @@ -1,17 +1,31 @@ define(ProductAttributeValue::class, function (Faker $faker) { - return [ - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'locale' => 'en', - 'channel' => 'default', - ]; -}); +class ProductAttributeValueFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = ProductAttributeValue::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + //'product_id' => Product::factory(), + 'locale' => 'en', + 'channel' => 'default', + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkFactory.php index e2cb8668e51..d088ef3fd38 100644 --- a/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkFactory.php +++ b/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkFactory.php @@ -1,35 +1,41 @@ define(ProductDownloadableLink::class, function (Faker $faker) { - $now = date("Y-m-d H:i:s"); - $filename = 'ProductImageExampleForUpload.jpg'; - $filepath = '/tests/_data/'; - - return [ - 'url' => '', - 'file' => $filepath . $filename, - 'file_name' => $filename, - 'type' => 'file', - 'price' => 0.0000, - 'downloads' => $faker->randomNumber(1), - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'created_at' => $now, - 'updated_at' => $now, - ]; -}); +class ProductDownloadableLinkFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = ProductDownloadableLink::class; -$factory->define(ProductDownloadableLinkTranslation::class, function (Faker $faker) { - return [ - 'locale' => 'en', - 'title' => $faker->word, - ]; -}); + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $now = date("Y-m-d H:i:s"); + $filename = 'ProductImageExampleForUpload.jpg'; + $filepath = '/tests/_data/'; + + return [ + 'url' => '', + 'file' => $filepath . $filename, + 'file_name' => $filename, + 'type' => 'file', + 'price' => 0.0000, + 'downloads' => $this->faker->randomNumber(1), + 'product_id' => Product::factory(), + 'created_at' => $now, + 'updated_at' => $now, + ]; + } +} diff --git a/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkTranslation.php b/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkTranslation.php deleted file mode 100644 index 1a9ecdcfce8..00000000000 --- a/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkTranslation.php +++ /dev/null @@ -1,17 +0,0 @@ -define(ProductDownloadableLinkTranslation::class, function (Faker $faker) { - return [ - 'locale' => 'en', - 'title' => $faker->word, - 'product_downloadable_link_id' => function () { - return factory(ProductDownloadableLink::class)->create()->id; - }, - ]; -}); diff --git a/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkTranslationFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkTranslationFactory.php new file mode 100644 index 00000000000..7a01705b48b --- /dev/null +++ b/packages/Webkul/Product/src/Database/Factories/ProductDownloadableLinkTranslationFactory.php @@ -0,0 +1,31 @@ + 'en', + 'title' => $this->faker->word, + 'product_downloadable_link_id' => ProductDownloadableLink::factory(), + ]; + } +} diff --git a/packages/Webkul/Product/src/Database/Factories/ProductFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductFactory.php index d0f4240b84d..207434b3016 100644 --- a/packages/Webkul/Product/src/Database/Factories/ProductFactory.php +++ b/packages/Webkul/Product/src/Database/Factories/ProductFactory.php @@ -1,29 +1,75 @@ define(Product::class, function (Faker $faker) { - return [ - 'sku' => $faker->uuid, - 'attribute_family_id' => 1, +class ProductFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Product::class; + + /** + * @var string[] + */ + protected $states = [ + 'simple', + 'virtual', + 'downloadable', + 'booking', ]; -}); -$factory->state(Product::class, 'simple', [ - 'type' => 'simple', -]); + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'sku' => $this->faker->uuid, + 'attribute_family_id' => 1, + ]; + } + + public function simple(): ProductFactory + { + return $this->state(function (array $attributes) { + return [ + 'type' => 'simple', + ]; + }); + } -$factory->state(Product::class, 'virtual', [ - 'type' => 'virtual', -]); + public function virtual(): ProductFactory + { + return $this->state(function (array $attributes) { + return [ + 'type' => 'virtual', + ]; + }); + } -$factory->state(Product::class, 'downloadable', [ - 'type' => 'downloadable', -]); + public function downloadable(): ProductFactory + { + return $this->state(function (array $attributes) { + return [ + 'type' => 'downloadable', + ]; + }); + } -$factory->state(Product::class, 'booking', [ - 'type' => 'booking', -]); \ No newline at end of file + public function booking(): ProductFactory + { + return $this->state(function (array $attributes) { + return [ + 'type' => 'booking', + ]; + }); + } +} \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php index 53e81effe75..d2fce80d90a 100644 --- a/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php +++ b/packages/Webkul/Product/src/Database/Factories/ProductInventoryFactory.php @@ -1,20 +1,32 @@ define(ProductInventory::class, function (Faker $faker) { - return [ - 'qty' => $faker->numberBetween(100, 200), - 'product_id' => function () { - return factory(Product::class)->create()->id; - }, - 'inventory_source_id' => function () { - return factory(InventorySource::class)->create()->id; - }, - ]; -}); \ No newline at end of file +class ProductInventoryFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = ProductInventory::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'qty' => $this->faker->numberBetween(100, 200), + 'product_id' => Product::factory(), + 'inventory_source_id' => InventorySource::factory(), + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductReviewFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductReviewFactory.php index 34926b1c073..b23f76856ea 100644 --- a/packages/Webkul/Product/src/Database/Factories/ProductReviewFactory.php +++ b/packages/Webkul/Product/src/Database/Factories/ProductReviewFactory.php @@ -1,20 +1,33 @@ define(ProductReview::class, function (Faker $faker, array $attributes) { - if (! array_key_exists('product_id', $attributes)) { - throw new InvalidArgumentException('product_id must be provided. You may use $I->haveProduct() to generate a product'); - } +class ProductReviewFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = ProductReview::class; - return [ - 'title' => $faker->words(5, true), - 'rating' => $faker->numberBetween(0, 10), - 'status' => 1, - 'comment' => $faker->sentence(20), - 'product_id' => $attributes['product_id'], - ]; -}); + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'title' => $this->faker->words(5, true), + 'rating' => $this->faker->numberBetween(0, 10), + 'status' => 1, + 'comment' => $this->faker->sentence(20), + 'product_id' => Product::factory(), + ]; + } +} diff --git a/packages/Webkul/Product/src/Database/Seeders/ProductTableSeeder.php b/packages/Webkul/Product/src/Database/Seeders/ProductTableSeeder.php index 88f26ae8aaf..198852bf846 100755 --- a/packages/Webkul/Product/src/Database/Seeders/ProductTableSeeder.php +++ b/packages/Webkul/Product/src/Database/Seeders/ProductTableSeeder.php @@ -1,14 +1,14 @@ 'array' + 'additional' => 'array', ]; /** @@ -55,7 +63,7 @@ class Product extends Model implements ProductContract * * @return void */ - protected static function booted() + protected static function booted(): void { parent::boot(); @@ -77,7 +85,7 @@ protected static function booted() * * @return void */ - public function refreshloadedAttributeValues() + public function refreshloadedAttributeValues(): void { self::$loadedAttributeValues = []; } @@ -85,7 +93,7 @@ public function refreshloadedAttributeValues() /** * Get the product attribute family that owns the product. */ - public function attribute_family() + public function attribute_family(): BelongsTo { return $this->belongsTo(AttributeFamilyProxy::modelClass()); } @@ -93,7 +101,7 @@ public function attribute_family() /** * Get the product attribute values that owns the product. */ - public function attribute_values() + public function attribute_values(): HasMany { return $this->hasMany(ProductAttributeValueProxy::modelClass()); } @@ -102,7 +110,7 @@ public function attribute_values() * Get the product flat entries that are associated with product. * May be one for each locale and each channel. */ - public function product_flats() + public function product_flats(): HasMany { return $this->hasMany(ProductFlatProxy::modelClass(), 'product_id'); } @@ -110,7 +118,7 @@ public function product_flats() /** * Get the product variants that owns the product. */ - public function variants() + public function variants(): HasMany { return $this->hasMany(static::class, 'parent_id'); } @@ -118,7 +126,7 @@ public function variants() /** * Get the product reviews that owns the product. */ - public function reviews() + public function reviews(): HasMany { return $this->hasMany(ProductReviewProxy::modelClass()); } @@ -126,7 +134,7 @@ public function reviews() /** * Get the product that owns the product. */ - public function parent() + public function parent(): BelongsTo { return $this->belongsTo(static::class, 'parent_id'); } @@ -134,7 +142,7 @@ public function parent() /** * The categories that belong to the product. */ - public function categories() + public function categories(): BelongsToMany { return $this->belongsToMany(CategoryProxy::modelClass(), 'product_categories'); } @@ -142,7 +150,7 @@ public function categories() /** * The inventories that belong to the product. */ - public function inventories() + public function inventories(): HasMany { return $this->hasMany(ProductInventoryProxy::modelClass(), 'product_id'); } @@ -150,7 +158,7 @@ public function inventories() /** * The ordered inventories that belong to the product. */ - public function ordered_inventories() + public function ordered_inventories(): HasMany { return $this->hasMany(ProductOrderedInventoryProxy::modelClass(), 'product_id'); } @@ -158,15 +166,16 @@ public function ordered_inventories() /** * The inventory sources that belong to the product. */ - public function inventory_sources() + public function inventory_sources(): BelongsToMany { - return $this->belongsToMany(InventorySourceProxy::modelClass(), 'product_inventories')->withPivot('id', 'qty'); + return $this->belongsToMany(InventorySourceProxy::modelClass(), 'product_inventories') + ->withPivot('id', 'qty'); } /** * The super attributes that belong to the product. */ - public function super_attributes() + public function super_attributes(): BelongsToMany { return $this->belongsToMany(AttributeProxy::modelClass(), 'product_super_attributes'); } @@ -174,7 +183,7 @@ public function super_attributes() /** * The images that belong to the product. */ - public function images() + public function images(): HasMany { return $this->hasMany(ProductImageProxy::modelClass(), 'product_id'); } @@ -182,7 +191,7 @@ public function images() /** * The videos that belong to the product. */ - public function videos() + public function videos(): HasMany { return $this->hasMany(ProductVideoProxy::modelClass(), 'product_id'); } @@ -192,39 +201,43 @@ public function videos() */ public function getBaseImageUrlAttribute() { - $image = $this->images()->first(); + $image = $this->images() + ->first(); - return $image ? $image->url : null; + return $image->url ?? null; } /** * The related products that belong to the product. */ - public function related_products() + public function related_products(): BelongsToMany { - return $this->belongsToMany(static::class, 'product_relations', 'parent_id', 'child_id')->limit(4); + return $this->belongsToMany(static::class, 'product_relations', 'parent_id', 'child_id') + ->limit(4); } /** * The up sells that belong to the product. */ - public function up_sells() + public function up_sells(): BelongsToMany { - return $this->belongsToMany(static::class, 'product_up_sells', 'parent_id', 'child_id')->limit(4); + return $this->belongsToMany(static::class, 'product_up_sells', 'parent_id', 'child_id') + ->limit(4); } /** * The cross sells that belong to the product. */ - public function cross_sells() + public function cross_sells(): BelongsToMany { - return $this->belongsToMany(static::class, 'product_cross_sells', 'parent_id', 'child_id')->limit(4); + return $this->belongsToMany(static::class, 'product_cross_sells', 'parent_id', 'child_id') + ->limit(4); } /** * The images that belong to the product. */ - public function downloadable_samples() + public function downloadable_samples(): HasMany { return $this->hasMany(ProductDownloadableSampleProxy::modelClass()); } @@ -232,7 +245,7 @@ public function downloadable_samples() /** * The images that belong to the product. */ - public function downloadable_links() + public function downloadable_links(): HasMany { return $this->hasMany(ProductDownloadableLinkProxy::modelClass()); } @@ -240,7 +253,7 @@ public function downloadable_links() /** * Get the grouped products that owns the product. */ - public function grouped_products() + public function grouped_products(): HasMany { return $this->hasMany(ProductGroupedProductProxy::modelClass()); } @@ -248,7 +261,7 @@ public function grouped_products() /** * Get the bundle options that owns the product. */ - public function bundle_options() + public function bundle_options(): HasMany { return $this->hasMany(ProductBundleOptionProxy::modelClass()); } @@ -256,7 +269,7 @@ public function bundle_options() /** * Get the product customer group prices that owns the product. */ - public function customer_group_prices() + public function customer_group_prices(): HasMany { return $this->hasMany(ProductCustomerGroupPriceProxy::modelClass()); } @@ -264,22 +277,24 @@ public function customer_group_prices() /** * Get inventory source quantity. * - * @param integer $qty + * @param $inventorySourceId + * * @return bool */ - public function inventory_source_qty($inventorySourceId) + public function inventory_source_qty($inventorySourceId): bool { return $this->inventories() - ->where('inventory_source_id', $inventorySourceId) - ->sum('qty'); + ->where('inventory_source_id', $inventorySourceId) + ->sum('qty'); } /** * Get type instance. * * @return AbstractType + * @throws \Exception */ - public function getTypeInstance() + public function getTypeInstance(): AbstractType { if ($this->typeInstance) { return $this->typeInstance; @@ -288,9 +303,7 @@ public function getTypeInstance() $this->typeInstance = app(config('product_types.' . $this->type . '.class')); if (! $this->typeInstance instanceof AbstractType) { - throw new Exception( - "Please ensure the product type '{$this->type}' is configured in your application." - ); + throw new Exception("Please ensure the product type '{$this->type}' is configured in your application."); } $this->typeInstance->setProduct($this); @@ -301,61 +314,76 @@ public function getTypeInstance() /** * Is saleable. * - * @param string $key + * @param string $key + * * @return bool + * @throws \Exception */ - public function isSaleable() + public function isSaleable(): bool { - return $this->getTypeInstance()->isSaleable(); + return $this->getTypeInstance() + ->isSaleable(); } /** * Total quantity. * * @return integer + * @throws \Exception */ - public function totalQuantity() + public function totalQuantity(): int { - return $this->getTypeInstance()->totalQuantity(); + return $this->getTypeInstance() + ->totalQuantity(); } /** * Have sufficient quantity. * - * @param int $qty + * @param int $qty + * * @return bool + * @throws \Exception */ public function haveSufficientQuantity(int $qty): bool { - return $this->getTypeInstance()->haveSufficientQuantity($qty); + return $this->getTypeInstance() + ->haveSufficientQuantity($qty); } /** * Is stockable. * * @return bool + * @throws \Exception */ - public function isStockable() + public function isStockable(): bool { - return $this->getTypeInstance()->isStockable(); + return $this->getTypeInstance() + ->isStockable(); } /** * Get an attribute from the model. * - * @param string $key + * @param string $key + * * @return mixed */ public function getAttribute($key) { if (! method_exists(static::class, $key) - && ! in_array($key, ['pivot', 'parent_id', 'attribute_family_id']) - && ! isset($this->attributes[$key]) - ) { + && ! in_array($key, [ + 'pivot', + 'parent_id', + 'attribute_family_id', + ]) + && ! isset($this->attributes[$key])) { if (isset($this->id)) { $this->attributes[$key] = ''; - $attribute = core()->getSingletonInstance(AttributeRepository::class) + $attribute = core() + ->getSingletonInstance(AttributeRepository::class) ->getAttributeByCode($key); $this->attributes[$key] = $this->getCustomAttributeValue($attribute); @@ -370,14 +398,16 @@ public function getAttribute($key) /** * Retrieve product attributes. * - * @param Group $group - * @param bool $skipSuperAttribute + * @param Group $group + * @param bool $skipSuperAttribute * - * @return Collection + * @return \Illuminate\Support\Collection + * @throws \Exception */ - public function getEditableAttributes($group = null, $skipSuperAttribute = true) + public function getEditableAttributes($group = null, $skipSuperAttribute = true): Collection { - return $this->getTypeInstance()->getEditableAttributes($group, $skipSuperAttribute); + return $this->getTypeInstance() + ->getEditableAttributes($group, $skipSuperAttribute); } /** @@ -394,24 +424,34 @@ public function getCustomAttributeValue($attribute) $locale = core()->checkRequestedLocaleCodeInRequestedChannel(); $channel = core()->getRequestedChannelCode(); - if ( - array_key_exists($this->id, self::$loadedAttributeValues) - && array_key_exists($attribute->id, self::$loadedAttributeValues[$this->id]) - ) { + if (array_key_exists($this->id, self::$loadedAttributeValues) + && array_key_exists($attribute->id, self::$loadedAttributeValues[$this->id])) { return self::$loadedAttributeValues[$this->id][$attribute->id]; } if ($attribute->value_per_channel) { if ($attribute->value_per_locale) { - $attributeValue = $this->attribute_values()->where('channel', $channel)->where('locale', $locale)->where('attribute_id', $attribute->id)->first(); + $attributeValue = $this->attribute_values() + ->where('channel', $channel) + ->where('locale', $locale) + ->where('attribute_id', $attribute->id) + ->first(); } else { - $attributeValue = $this->attribute_values()->where('channel', $channel)->where('attribute_id', $attribute->id)->first(); + $attributeValue = $this->attribute_values() + ->where('channel', $channel) + ->where('attribute_id', $attribute->id) + ->first(); } } else { if ($attribute->value_per_locale) { - $attributeValue = $this->attribute_values()->where('locale', $locale)->where('attribute_id', $attribute->id)->first(); + $attributeValue = $this->attribute_values() + ->where('locale', $locale) + ->where('attribute_id', $attribute->id) + ->first(); } else { - $attributeValue = $this->attribute_values()->where('attribute_id', $attribute->id)->first(); + $attributeValue = $this->attribute_values() + ->where('attribute_id', $attribute->id) + ->first(); } } @@ -423,7 +463,7 @@ public function getCustomAttributeValue($attribute) * * @return array */ - public function attributesToArray() + public function attributesToArray(): array { $attributes = parent::attributesToArray(); @@ -448,6 +488,7 @@ public function attributesToArray() * Overrides the default Eloquent query builder. * * @param \Illuminate\Database\Query\Builder $query + * * @return \Webkul\Product\Database\Eloquent\Builder */ public function newEloquentBuilder($query) @@ -476,7 +517,7 @@ public function getProductAttribute() * * @return object */ - public function checkInLoadedFamilyAttributes() + public function checkInLoadedFamilyAttributes(): object { static $loadedFamilyAttributes = []; @@ -484,7 +525,18 @@ public function checkInLoadedFamilyAttributes() return $loadedFamilyAttributes[$this->attribute_family_id]; } - return $loadedFamilyAttributes[$this->attribute_family_id] = core()->getSingletonInstance(AttributeRepository::class) + return $loadedFamilyAttributes[$this->attribute_family_id] = core() + ->getSingletonInstance(AttributeRepository::class) ->getFamilyAttributes($this->attribute_family); } + + /** + * Create a new factory instance for the model. + * + * @return ProductFactory + */ + protected static function newFactory(): ProductFactory + { + return ProductFactory::new(); + } } diff --git a/packages/Webkul/Product/src/Models/ProductAttributeValue.php b/packages/Webkul/Product/src/Models/ProductAttributeValue.php index 615baf5e506..f9ba4b7098e 100755 --- a/packages/Webkul/Product/src/Models/ProductAttributeValue.php +++ b/packages/Webkul/Product/src/Models/ProductAttributeValue.php @@ -4,10 +4,15 @@ use Illuminate\Database\Eloquent\Model; use Webkul\Attribute\Models\AttributeProxy; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Product\Database\Factories\ProductAttributeValueFactory; use Webkul\Product\Contracts\ProductAttributeValue as ProductAttributeValueContract; class ProductAttributeValue extends Model implements ProductAttributeValueContract { + use HasFactory; + /** * Indicates if the model should be timestamped. * @@ -21,17 +26,17 @@ class ProductAttributeValue extends Model implements ProductAttributeValueContra * @var array */ public static $attributeTypeFields = [ - 'text' => 'text_value', - 'textarea' => 'text_value', - 'price' => 'float_value', - 'boolean' => 'boolean_value', - 'select' => 'integer_value', + 'text' => 'text_value', + 'textarea' => 'text_value', + 'price' => 'float_value', + 'boolean' => 'boolean_value', + 'select' => 'integer_value', 'multiselect' => 'text_value', - 'datetime' => 'datetime_value', - 'date' => 'date_value', - 'file' => 'text_value', - 'image' => 'text_value', - 'checkbox' => 'text_value', + 'datetime' => 'datetime_value', + 'date' => 'date_value', + 'file' => 'text_value', + 'image' => 'text_value', + 'checkbox' => 'text_value', ]; /** @@ -56,7 +61,7 @@ class ProductAttributeValue extends Model implements ProductAttributeValueContra /** * Get the attribute that owns the attribute value. */ - public function attribute() + public function attribute(): BelongsTo { return $this->belongsTo(AttributeProxy::modelClass()); } @@ -64,8 +69,18 @@ public function attribute() /** * Get the product that owns the attribute value. */ - public function product() + public function product(): BelongsTo { return $this->belongsTo(ProductProxy::modelClass()); } + + /** + * Create a new factory instance for the model. + * + * @return ProductAttributeValueFactory + */ + protected static function newFactory(): ProductAttributeValueFactory + { + return ProductAttributeValueFactory::new(); + } } diff --git a/packages/Webkul/Product/src/Models/ProductDownloadableLink.php b/packages/Webkul/Product/src/Models/ProductDownloadableLink.php index 88bf361c544..c02abc64430 100644 --- a/packages/Webkul/Product/src/Models/ProductDownloadableLink.php +++ b/packages/Webkul/Product/src/Models/ProductDownloadableLink.php @@ -4,10 +4,14 @@ use Webkul\Core\Eloquent\TranslatableModel; use Illuminate\Support\Facades\Storage; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Product\Database\Factories\ProductDownloadableLinkFactory; use Webkul\Product\Contracts\ProductDownloadableLink as ProductDownloadableLinkContract; class ProductDownloadableLink extends TranslatableModel implements ProductDownloadableLinkContract { + use HasFactory; + public $translatedAttributes = ['title']; protected $fillable = [ @@ -31,7 +35,7 @@ class ProductDownloadableLink extends TranslatableModel implements ProductDownlo /** * Get the product that owns the image. */ - public function product() + public function product(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(ProductProxy::modelClass()); } @@ -39,7 +43,7 @@ public function product() /** * Get image url for the file. */ - public function file_url() + public function file_url(): string { return Storage::url($this->path); } @@ -47,7 +51,7 @@ public function file_url() /** * Get image url for the file. */ - public function getFileUrlAttribute() + public function getFileUrlAttribute(): string { return $this->file_url(); } @@ -55,7 +59,7 @@ public function getFileUrlAttribute() /** * Get image url for the sample file. */ - public function sample_file_url() + public function sample_file_url(): string { return Storage::url($this->path); } @@ -63,7 +67,7 @@ public function sample_file_url() /** * Get image url for the sample file. */ - public function getSampleFileUrlAttribute() + public function getSampleFileUrlAttribute(): string { return $this->sample_file_url(); } @@ -71,13 +75,13 @@ public function getSampleFileUrlAttribute() /** * @return array */ - public function toArray() + public function toArray(): array { $array = parent::toArray(); $translation = $this->translate(core()->getRequestedLocaleCode()); - $array['title'] = $translation ? $translation->title : ''; + $array['title'] = $translation->title ?? ''; $array['file_url'] = $this->file ? Storage::url($this->file) : null; @@ -85,4 +89,14 @@ public function toArray() return $array; } + + /** + * Create a new factory instance for the model. + * + * @return ProductDownloadableLinkFactory + */ + protected static function newFactory(): ProductDownloadableLinkFactory + { + return ProductDownloadableLinkFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Models/ProductDownloadableLinkTranslation.php b/packages/Webkul/Product/src/Models/ProductDownloadableLinkTranslation.php index 8dfe77b4efc..f630413ddb5 100644 --- a/packages/Webkul/Product/src/Models/ProductDownloadableLinkTranslation.php +++ b/packages/Webkul/Product/src/Models/ProductDownloadableLinkTranslation.php @@ -3,11 +3,25 @@ namespace Webkul\Product\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Product\Database\Factories\ProductDownloadableLinkTranslationFactory; use Webkul\Product\Contracts\ProductDownloadableLinkTranslation as ProductDownloadableLinkTranslationContract; class ProductDownloadableLinkTranslation extends Model implements ProductDownloadableLinkTranslationContract { + use HasFactory; + public $timestamps = false; protected $fillable = ['title']; + + /** + * Create a new factory instance for the model. + * + * @return ProductDownloadableLinkTranslationFactory + */ + protected static function newFactory(): ProductDownloadableLinkTranslationFactory + { + return ProductDownloadableLinkTranslationFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Models/ProductInventory.php b/packages/Webkul/Product/src/Models/ProductInventory.php index 4b7d413013f..9ab93a44903 100755 --- a/packages/Webkul/Product/src/Models/ProductInventory.php +++ b/packages/Webkul/Product/src/Models/ProductInventory.php @@ -4,10 +4,15 @@ use Illuminate\Database\Eloquent\Model; use Webkul\Inventory\Models\InventorySourceProxy; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Product\Database\Factories\ProductInventoryFactory; use Webkul\Product\Contracts\ProductInventory as ProductInventoryContract; class ProductInventory extends Model implements ProductInventoryContract { + use HasFactory; + public $timestamps = false; protected $fillable = [ @@ -20,7 +25,7 @@ class ProductInventory extends Model implements ProductInventoryContract /** * Get the product attribute family that owns the product. */ - public function inventory_source() + public function inventory_source(): BelongsTo { return $this->belongsTo(InventorySourceProxy::modelClass()); } @@ -28,8 +33,18 @@ public function inventory_source() /** * Get the product that owns the product inventory. */ - public function product() + public function product(): BelongsTo { return $this->belongsTo(ProductProxy::modelClass()); } + + /** + * Create a new factory instance for the model. + * + * @return ProductInventoryFactory + */ + protected static function newFactory(): ProductInventoryFactory + { + return ProductInventoryFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Models/ProductReview.php b/packages/Webkul/Product/src/Models/ProductReview.php index 859b38fec4c..70ee1b2396a 100755 --- a/packages/Webkul/Product/src/Models/ProductReview.php +++ b/packages/Webkul/Product/src/Models/ProductReview.php @@ -4,11 +4,16 @@ use Illuminate\Database\Eloquent\Model; use Webkul\Customer\Models\CustomerProxy; -use Webkul\Product\Models\Product; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Product\Database\Factories\ProductReviewFactory; use Webkul\Product\Contracts\ProductReview as ProductReviewContract; class ProductReview extends Model implements ProductReviewContract { + use HasFactory; + protected $fillable = [ 'comment', 'title', @@ -22,7 +27,7 @@ class ProductReview extends Model implements ProductReviewContract /** * Get the product attribute family that owns the product. */ - public function customer() + public function customer(): BelongsTo { return $this->belongsTo(CustomerProxy::modelClass()); } @@ -30,7 +35,7 @@ public function customer() /** * Get the product. */ - public function product() + public function product(): BelongsTo { return $this->belongsTo(ProductProxy::modelClass()); } @@ -38,8 +43,18 @@ public function product() /** * The images that belong to the review. */ - public function images() + public function images(): HasMany { return $this->hasMany(ProductReviewImageProxy::modelClass(), 'review_id'); } + + /** + * Create a new factory instance for the model. + * + * @return ProductReviewFactory + */ + protected static function newFactory(): ProductReviewFactory + { + return ProductReviewFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Providers/ProductServiceProvider.php b/packages/Webkul/Product/src/Providers/ProductServiceProvider.php index 783b6a28672..d9a1a3adb68 100755 --- a/packages/Webkul/Product/src/Providers/ProductServiceProvider.php +++ b/packages/Webkul/Product/src/Providers/ProductServiceProvider.php @@ -2,12 +2,10 @@ namespace Webkul\Product\Providers; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Support\ServiceProvider; use Webkul\Product\Models\ProductProxy; use Webkul\Product\Observers\ProductObserver; use Webkul\Product\Console\Commands\PriceUpdate; -use Webkul\Product\Console\Commands\GenerateProducts; use Illuminate\Foundation\AliasLoader; use Webkul\Product\Facades\ProductImage as ProductImageFacade; use Webkul\Product\Facades\ProductVideo as ProductVideoFacade; @@ -21,14 +19,12 @@ class ProductServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { include __DIR__ . '/../Http/helpers.php'; $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); - $this->app->make(EloquentFactory::class)->load(__DIR__ . '/../Database/Factories'); - $this->app->register(EventServiceProvider::class); $this->publishes([ @@ -50,8 +46,6 @@ public function register(): void $this->registerCommands(); $this->registerFacades(); - - $this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories'); } /** @@ -61,9 +55,7 @@ public function register(): void */ public function registerConfig(): void { - $this->mergeConfigFrom( - dirname(__DIR__) . '/Config/product_types.php', 'product_types' - ); + $this->mergeConfigFrom(dirname(__DIR__) . '/Config/product_types.php', 'product_types'); } /** @@ -74,28 +66,16 @@ public function registerConfig(): void protected function registerCommands(): void { if ($this->app->runningInConsole()) { - $this->commands([PriceUpdate::class, GenerateProducts::class,]); + $this->commands([PriceUpdate::class]); } } - /** - * Register factories. - * - * @param string $path - * @return void - */ - protected function registerEloquentFactoriesFrom($path): void - { - $this->app->make(EloquentFactory::class)->load($path); - } - - /** * Register Bouncer as a singleton. * * @return void */ - protected function registerFacades() + protected function registerFacades(): void { // Product image $loader = AliasLoader::getInstance(); diff --git a/packages/Webkul/Sales/src/Database/Factories/InventorySourceFactory.php b/packages/Webkul/Sales/src/Database/Factories/InventorySourceFactory.php deleted file mode 100644 index 2ac56182c47..00000000000 --- a/packages/Webkul/Sales/src/Database/Factories/InventorySourceFactory.php +++ /dev/null @@ -1,26 +0,0 @@ -define(InventorySource::class, function (Faker $faker) { - $code = $faker->unique()->word; - - return [ - 'code' => $faker->unique()->word, - 'name' => $code, - 'description' => $faker->sentence, - 'contact_name' => $faker->name, - 'contact_email' => $faker->safeEmail, - 'contact_number' => $faker->phoneNumber, - 'country' => $faker->countryCode, - 'state' => $faker->state, - 'city' => $faker->city, - 'street' => $faker->streetAddress, - 'postcode' => $faker->postcode, - 'priority' => 0, - 'status' => 1, - ]; -}); diff --git a/packages/Webkul/Sales/src/Database/Factories/InvoiceFactory.php b/packages/Webkul/Sales/src/Database/Factories/InvoiceFactory.php index 03c5cd36f6e..1c66343361a 100644 --- a/packages/Webkul/Sales/src/Database/Factories/InvoiceFactory.php +++ b/packages/Webkul/Sales/src/Database/Factories/InvoiceFactory.php @@ -1,61 +1,94 @@ define(Invoice::class, function (Faker $faker, array $attributes) { - $subTotal = $faker->randomFloat(2); - $shippingAmount = $faker->randomFloat(2); - $taxAmount = $faker->randomFloat(2); +class InvoiceFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Invoice::class; - if (! isset($attributes['order_id'])) { - $attributes['order_id'] = function () { - return factory(Order::class)->create()->id; - }; - } + /** + * @var array + */ + protected $states = [ + 'pending', + 'paid', + 'refunded', + ]; - if (! isset($attributes['order_address_id'])) { - $attributes['order_address_id'] = function () use ($attributes) { - return factory(OrderAddress::class) - ->create(['order_id' => $attributes['order_id']]) - ->id; - }; - } + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $subTotal = $this->faker->randomFloat(2); + $shippingAmount = $this->faker->randomFloat(2); + $taxAmount = $this->faker->randomFloat(2); - return [ - 'email_sent' => 0, - 'total_qty' => $faker->randomNumber(), - 'base_currency_code' => 'EUR', - 'channel_currency_code' => 'EUR', - 'order_currency_code' => 'EUR', - 'sub_total' => $subTotal, - 'base_sub_total' => $subTotal, - 'grand_total' => $subTotal, - 'base_grand_total' => $subTotal, - 'shipping_amount' => $shippingAmount, - 'base_shipping_amount' => $shippingAmount, - 'tax_amount' => $taxAmount, - 'base_tax_amount' => $taxAmount, - 'discount_amount' => 0, - 'base_discount_amount' => 0, - 'order_id' => $attributes['order_id'], - 'order_address_id' => $attributes['order_address_id'], - ]; -}); + if (!isset($attributes['order_id'])) { + $attributes['order_id'] = Order::factory(); + } -$factory->state(Invoice::class, 'pending', [ - 'status' => 'pending', -]); + if (!isset($attributes['order_address_id'])) { + $attributes['order_address_id'] = OrderAddress::factory(); + } -$factory->state(Invoice::class, 'paid', [ - 'status' => 'paid', -]); + return [ + 'email_sent' => 0, + 'total_qty' => $this->faker->randomNumber(), + 'base_currency_code' => 'EUR', + 'channel_currency_code' => 'EUR', + 'order_currency_code' => 'EUR', + 'sub_total' => $subTotal, + 'base_sub_total' => $subTotal, + 'grand_total' => $subTotal, + 'base_grand_total' => $subTotal, + 'shipping_amount' => $shippingAmount, + 'base_shipping_amount' => $shippingAmount, + 'tax_amount' => $taxAmount, + 'base_tax_amount' => $taxAmount, + 'discount_amount' => 0, + 'base_discount_amount' => 0, + 'order_id' => $attributes['order_id'], + 'order_address_id' => $attributes['order_address_id'], + ]; + } -$factory->state(Invoice::class, 'refunded', [ - 'status' => 'refunded', -]); + public function pending(): InvoiceFactory + { + return $this->state(function (array $attributes) { + return [ + 'status' => 'pending', + ]; + }); + } + + public function paid(): InvoiceFactory + { + return $this->state(function (array $attributes) { + return [ + 'status' => 'paid', + ]; + }); + } + public function refunded(): InvoiceFactory + { + return $this->state(function (array $attributes) { + return [ + 'status' => 'refunded', + ]; + }); + } +} \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Database/Factories/InvoiceItemFactory.php b/packages/Webkul/Sales/src/Database/Factories/InvoiceItemFactory.php index 21cd8741152..36267a4e55a 100644 --- a/packages/Webkul/Sales/src/Database/Factories/InvoiceItemFactory.php +++ b/packages/Webkul/Sales/src/Database/Factories/InvoiceItemFactory.php @@ -1,41 +1,52 @@ define(InvoiceItem::class, function (Faker $faker, array $attributes) { +class InvoiceItemFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = InvoiceItem::class; - $basePrice = $faker->randomFloat(2); - $quantity = $faker->randomNumber(); + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $basePrice = $this->faker->randomFloat(2); + $quantity = $this->faker->randomNumber(); - if (! $attributes['order_item_id']) { - $attributes['order_item_id'] = function () { - return factory(OrderItem::class)->create()->id; - }; - } + if (!isset($attributes['order_item_id'])) { + $attributes['order_item_id'] = OrderItem::factory(); + } - $orderItem = OrderItem::find($attributes['order_item_id']); + $orderItem = OrderItem::query() + ->find($attributes['order_item_id']); - return [ - 'name' => $faker->word, - 'sku' => $faker->unique()->ean13, - 'qty' => $quantity, - 'price' => $basePrice, - 'base_price' => $basePrice, - 'total' => $quantity * $basePrice, - 'base_total' => $quantity * $basePrice, - 'tax_amount' => 0, - 'base_tax_amount' => 0, - 'product_id' => $orderItem->product_id, - 'product_type' => $orderItem->product_type, - 'order_item_id' => $attributes['order_item_id'], - 'invoice_id' => function () { - return factory(Invoice::class)->create()->id; - }, - ]; -}); + return [ + 'name' => $this->faker->word, + 'sku' => $this->faker->unique()->ean13, + 'qty' => $quantity, + 'price' => $basePrice, + 'base_price' => $basePrice, + 'total' => $quantity * $basePrice, + 'base_total' => $quantity * $basePrice, + 'tax_amount' => 0, + 'base_tax_amount' => 0, + 'product_id' => $orderItem->product_id, + 'product_type' => $orderItem->product_type, + 'order_item_id' => $attributes['order_item_id'], + 'invoice_id' => Invoice::factory(), + ]; + } +} diff --git a/packages/Webkul/Sales/src/Database/Factories/OrderAddressFactory.php b/packages/Webkul/Sales/src/Database/Factories/OrderAddressFactory.php index d8b44c4bc65..87c3b337545 100644 --- a/packages/Webkul/Sales/src/Database/Factories/OrderAddressFactory.php +++ b/packages/Webkul/Sales/src/Database/Factories/OrderAddressFactory.php @@ -1,34 +1,62 @@ define(OrderAddress::class, function (Faker $faker) { - $customer = factory(Customer::class)->create(); - $customerAddress = factory(CustomerAddress::class)->make(); +class OrderAddressFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = OrderAddress::class; - return [ - 'first_name' => $customer->first_name, - 'last_name' => $customer->last_name, - 'email' => $customer->email, - 'address1' => $customerAddress->address1, - 'country' => $customerAddress->country, - 'state' => $customerAddress->state, - 'city' => $customerAddress->city, - 'postcode' => $customerAddress->postcode, - 'phone' => $customerAddress->phone, - 'address_type' => OrderAddress::ADDRESS_TYPE_BILLING, - 'order_id' => function () { - return factory(Order::class)->create()->id; - }, + /** + * @var string[] + */ + protected $states = [ + 'shipping', ]; -}); -$factory->state(OrderAddress::class, 'shipping', [ - 'address_type' => OrderAddress::ADDRESS_TYPE_SHIPPING, -]); \ No newline at end of file + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $customer = Customer::factory() + ->create(); + $customerAddress = CustomerAddress::factory() + ->make(); + + return [ + 'first_name' => $customer->first_name, + 'last_name' => $customer->last_name, + 'email' => $customer->email, + 'address1' => $customerAddress->address1, + 'country' => $customerAddress->country, + 'state' => $customerAddress->state, + 'city' => $customerAddress->city, + 'postcode' => $customerAddress->postcode, + 'phone' => $customerAddress->phone, + 'address_type' => OrderAddress::ADDRESS_TYPE_BILLING, + 'order_id' => Order::factory(), + ]; + } + + public function shipping(): void + { + $this->state(function (array $attributes) { + return [ + 'address_type' => OrderAddress::ADDRESS_TYPE_SHIPPING, + ]; + }); + } +} \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Database/Factories/OrderFactory.php b/packages/Webkul/Sales/src/Database/Factories/OrderFactory.php index a32a31e65ab..93b57407b2d 100644 --- a/packages/Webkul/Sales/src/Database/Factories/OrderFactory.php +++ b/packages/Webkul/Sales/src/Database/Factories/OrderFactory.php @@ -1,67 +1,107 @@ define(Order::class, function (Faker $faker) { - $lastOrder = DB::table('orders') - ->orderBy('id', 'desc') - ->select('id') - ->first() - ->id ?? 0; +class OrderFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Order::class; + /** + * @var string[] + */ + protected $states = [ + 'pending', + 'completed', + 'closed', + ]; - $customer = factory(Customer::class)->create(); + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $lastOrder = DB::table('orders') + ->orderBy('id', 'desc') + ->select('id') + ->first()->id ?? 0; - return [ - 'increment_id' => $lastOrder + 1, - 'status' => 'pending', - 'channel_name' => 'Default', - 'is_guest' => 0, - 'customer_id' => $customer->id, - 'customer_email' => $customer->email, - 'customer_first_name' => $customer->first_name, - 'customer_last_name' => $customer->last_name, - 'is_gift' => 0, - 'total_item_count' => 1, - 'total_qty_ordered' => 1, - 'base_currency_code' => 'EUR', - 'channel_currency_code' => 'EUR', - 'order_currency_code' => 'EUR', - 'grand_total' => 0.0000, - 'base_grand_total' => 0.0000, - 'grand_total_invoiced' => 0.0000, - 'base_grand_total_invoiced' => 0.0000, - 'grand_total_refunded' => 0.0000, - 'base_grand_total_refunded' => 0.0000, - 'sub_total' => 0.0000, - 'base_sub_total' => 0.0000, - 'sub_total_invoiced' => 0.0000, - 'base_sub_total_invoiced' => 0.0000, - 'sub_total_refunded' => 0.0000, - 'base_sub_total_refunded' => 0.0000, - 'customer_type' => Customer::class, - 'channel_id' => 1, - 'channel_type' => Channel::class, - 'cart_id' => 0, - 'shipping_method' => 'free_free', - 'shipping_title' => 'Free Shipping', - ]; -}); -$factory->state(Order::class, 'pending', [ - 'status' => 'pending', -]); + $customer = Customer::factory() + ->create(); + + return [ + 'increment_id' => $lastOrder + 1, + 'status' => 'pending', + 'channel_name' => 'Default', + 'is_guest' => 0, + 'customer_id' => $customer->id, + 'customer_email' => $customer->email, + 'customer_first_name' => $customer->first_name, + 'customer_last_name' => $customer->last_name, + 'is_gift' => 0, + 'total_item_count' => 1, + 'total_qty_ordered' => 1, + 'base_currency_code' => 'EUR', + 'channel_currency_code' => 'EUR', + 'order_currency_code' => 'EUR', + 'grand_total' => 0.0000, + 'base_grand_total' => 0.0000, + 'grand_total_invoiced' => 0.0000, + 'base_grand_total_invoiced' => 0.0000, + 'grand_total_refunded' => 0.0000, + 'base_grand_total_refunded' => 0.0000, + 'sub_total' => 0.0000, + 'base_sub_total' => 0.0000, + 'sub_total_invoiced' => 0.0000, + 'base_sub_total_invoiced' => 0.0000, + 'sub_total_refunded' => 0.0000, + 'base_sub_total_refunded' => 0.0000, + 'customer_type' => Customer::class, + 'channel_id' => 1, + 'channel_type' => Channel::class, + 'cart_id' => 0, + 'shipping_method' => 'free_free', + 'shipping_title' => 'Free Shipping', + ]; + } + + public function pending(): OrderFactory + { + return $this->state(function (array $attributes) { + return [ + 'status' => 'pending', + ]; + }); + } -$factory->state(Order::class, 'completed', [ - 'status' => 'completed', -]); + public function completed(): OrderFactory + { + return $this->state(function (array $attributes) { + return [ + 'status' => 'completed', + ]; + }); + } -$factory->state(Order::class, 'closed', [ - 'status' => 'closed', -]); + public function closed(): OrderFactory + { + return $this->state(function (array $attributes) { + return [ + 'status' => 'closed', + ]; + }); + } +} diff --git a/packages/Webkul/Sales/src/Database/Factories/OrderItemFactory.php b/packages/Webkul/Sales/src/Database/Factories/OrderItemFactory.php index 7eeb89c7ba3..1920eb5842e 100644 --- a/packages/Webkul/Sales/src/Database/Factories/OrderItemFactory.php +++ b/packages/Webkul/Sales/src/Database/Factories/OrderItemFactory.php @@ -1,43 +1,61 @@ define(OrderItem::class, function (Faker $faker, array $attributes) { - $now = date("Y-m-d H:i:s"); +class OrderItemFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = OrderItem::class; - if (isset($attributes['product_id'])) { - $product = Product::where('id', $attributes['product_id'])->first(); - } else { - $product = factory(Product::class)->create(); - } + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $now = date("Y-m-d H:i:s"); + + if (isset($attributes['product_id'])) { + $product = Product::query() + ->where('id', $attributes['product_id']) + ->first(); + } else { + $product = Product::factory() + ->simple() + ->create(); + } - $fallbackPrice = $faker->randomFloat(4, 0, 1000); + $fallbackPrice = $this->faker->randomFloat(4, 0, 1000); - return [ - 'sku' => $product->sku, - 'type' => $product->type, - 'name' => $product->name, - 'price' => $product->price ?? $fallbackPrice, - 'base_price' => $product->price ?? $fallbackPrice, - 'total' => $product->price ?? $fallbackPrice, - 'base_total' => $product->price ?? $fallbackPrice, - 'product_id' => $product->id, - 'qty_ordered' => 1, - 'qty_shipped' => 0, - 'qty_invoiced' => 0, - 'qty_canceled' => 0, - 'qty_refunded' => 0, - 'additional' => [], - 'order_id' => function () { - return factory(Order::class)->create()->id; - }, - 'created_at' => $now, - 'updated_at' => $now, - 'product_type' => Product::class, - ]; -}); \ No newline at end of file + return [ + 'sku' => $product->sku, + 'type' => $product->type, + 'name' => $product->name, + 'price' => $product->price ?? $fallbackPrice, + 'base_price' => $product->price ?? $fallbackPrice, + 'total' => $product->price ?? $fallbackPrice, + 'base_total' => $product->price ?? $fallbackPrice, + 'product_id' => $product->id, + 'qty_ordered' => 1, + 'qty_shipped' => 0, + 'qty_invoiced' => 0, + 'qty_canceled' => 0, + 'qty_refunded' => 0, + 'additional' => [], + 'order_id' => Order::factory(), + 'created_at' => $now, + 'updated_at' => $now, + 'product_type' => Product::class, + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Database/Factories/OrderPaymentFactory.php b/packages/Webkul/Sales/src/Database/Factories/OrderPaymentFactory.php index 5acce649db8..cd462a99392 100644 --- a/packages/Webkul/Sales/src/Database/Factories/OrderPaymentFactory.php +++ b/packages/Webkul/Sales/src/Database/Factories/OrderPaymentFactory.php @@ -1,19 +1,29 @@ define(OrderPayment::class, function (Faker $faker, array $attributes) { +class OrderPaymentFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = OrderPayment::class; - if (!array_key_exists('order_id', $attributes)) { - throw new InvalidArgumentException('order_id must be provided.'); + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'method' => 'cashondelivery', + ]; } - - return [ - 'method' => 'cashondelivery', - ]; -}); +} diff --git a/packages/Webkul/Sales/src/Database/Factories/RefundFactory.php b/packages/Webkul/Sales/src/Database/Factories/RefundFactory.php index c4a5ba62a78..aebee283a8f 100644 --- a/packages/Webkul/Sales/src/Database/Factories/RefundFactory.php +++ b/packages/Webkul/Sales/src/Database/Factories/RefundFactory.php @@ -1,16 +1,30 @@ define(Refund::class, function (Faker $faker, array $attributes) { - return [ - 'order_id' => function () { - return factory(Order::class)->create()->id; - }, - ]; -}); +class RefundFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Refund::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'order_id' => Order::factory(), + ]; + } +} diff --git a/packages/Webkul/Sales/src/Database/Factories/ShipmentFactory.php b/packages/Webkul/Sales/src/Database/Factories/ShipmentFactory.php index 4332e18d341..81b00d53c82 100644 --- a/packages/Webkul/Sales/src/Database/Factories/ShipmentFactory.php +++ b/packages/Webkul/Sales/src/Database/Factories/ShipmentFactory.php @@ -1,22 +1,37 @@ define(Shipment::class, function (Faker $faker) { - $address = factory(OrderAddress::class)->create(); +class ShipmentFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = Shipment::class; - return [ - 'total_qty' => $faker->numberBetween(1, 20), - 'order_id' => $address->order_id, - 'order_address_id' => $address->id, - 'inventory_source_id' => function () { - return factory(InventorySource::class)->create()->id; - }, - ]; -}); + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $address = OrderAddress::factory() + ->create(); + + return [ + 'total_qty' => $this->faker->numberBetween(1, 20), + 'order_id' => $address->order_id, + 'order_address_id' => $address->id, + 'inventory_source_id' => InventorySource::factory(), + ]; + } +} diff --git a/packages/Webkul/Sales/src/Models/Invoice.php b/packages/Webkul/Sales/src/Models/Invoice.php index 3ce7d640dc2..0303aafb009 100755 --- a/packages/Webkul/Sales/src/Models/Invoice.php +++ b/packages/Webkul/Sales/src/Models/Invoice.php @@ -3,19 +3,28 @@ namespace Webkul\Sales\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Relations\HasMany; use Webkul\Sales\Contracts\Invoice as InvoiceContract; use Webkul\Sales\Traits\PaymentTerm; +use Webkul\Sales\Database\Factories\InvoiceFactory; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Invoice extends Model implements InvoiceContract { - use PaymentTerm; + use PaymentTerm, HasFactory; /** * The attributes that aren't mass assignable. * * @var string[]|bool */ - protected $guarded = ['id', 'created_at', 'updated_at']; + protected $guarded = [ + 'id', + 'created_at', + 'updated_at', + ]; /** * Invoice status. @@ -23,8 +32,8 @@ class Invoice extends Model implements InvoiceContract * @var array */ protected $statusLabel = [ - 'pending' => 'Pending', - 'paid' => 'Paid', + 'pending' => 'Pending', + 'paid' => 'Paid', 'refunded' => 'Refunded', ]; @@ -33,13 +42,13 @@ class Invoice extends Model implements InvoiceContract */ public function getStatusLabelAttribute() { - return isset($this->statusLabel[$this->state]) ? $this->statusLabel[$this->state] : ''; + return $this->statusLabel[$this->state] ?? ''; } /** * Get the order that belongs to the invoice. */ - public function order() + public function order(): BelongsTo { return $this->belongsTo(OrderProxy::modelClass()); } @@ -47,15 +56,16 @@ public function order() /** * Get the invoice items record associated with the invoice. */ - public function items() + public function items(): HasMany { - return $this->hasMany(InvoiceItemProxy::modelClass())->whereNull('parent_id'); + return $this->hasMany(InvoiceItemProxy::modelClass()) + ->whereNull('parent_id'); } /** * Get the customer record associated with the invoice. */ - public function customer() + public function customer(): MorphTo { return $this->morphTo(); } @@ -63,7 +73,7 @@ public function customer() /** * Get the channel record associated with the invoice. */ - public function channel() + public function channel(): MorphTo { return $this->morphTo(); } @@ -71,9 +81,19 @@ public function channel() /** * Get the address for the invoice. */ - public function address() + public function address(): BelongsTo { return $this->belongsTo(OrderAddressProxy::modelClass(), 'order_address_id') - ->where('address_type', OrderAddress::ADDRESS_TYPE_BILLING); + ->where('address_type', OrderAddress::ADDRESS_TYPE_BILLING); + } + + /** + * Create a new factory instance for the model. + * + * @return InvoiceFactory + */ + protected static function newFactory(): InvoiceFactory + { + return InvoiceFactory::new(); } } diff --git a/packages/Webkul/Sales/src/Models/InvoiceItem.php b/packages/Webkul/Sales/src/Models/InvoiceItem.php index 9eaa6f47c37..9d7c26ff080 100755 --- a/packages/Webkul/Sales/src/Models/InvoiceItem.php +++ b/packages/Webkul/Sales/src/Models/InvoiceItem.php @@ -2,12 +2,25 @@ namespace Webkul\Sales\Models; +use Webkul\Product\Type\AbstractType; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Sales\Database\Factories\InvoiceItemFactory; use Webkul\Sales\Contracts\InvoiceItem as InvoiceItemContract; class InvoiceItem extends Model implements InvoiceItemContract { - protected $guarded = ['id', 'created_at', 'updated_at']; + use HasFactory; + + protected $guarded = [ + 'id', + 'created_at', + 'updated_at', + ]; protected $casts = [ 'additional' => 'array', @@ -18,15 +31,15 @@ class InvoiceItem extends Model implements InvoiceItemContract * * @return AbstractType */ - public function getTypeInstance() + public function getTypeInstance(): AbstractType { return $this->order_item->getTypeInstance(); } - + /** * Get the invoice record associated with the invoice item. */ - public function invoice() + public function invoice(): BelongsTo { return $this->belongsTo(InvoiceProxy::modelClass()); } @@ -34,7 +47,7 @@ public function invoice() /** * Get the order item record associated with the invoice item. */ - public function order_item() + public function order_item(): BelongsTo { return $this->belongsTo(OrderItemProxy::modelClass()); } @@ -42,7 +55,7 @@ public function order_item() /** * Get the invoice record associated with the invoice item. */ - public function product() + public function product(): MorphTo { return $this->morphTo(); } @@ -50,7 +63,7 @@ public function product() /** * Get the child item record associated with the invoice item. */ - public function child() + public function child(): HasOne { return $this->hasOne(InvoiceItemProxy::modelClass(), 'parent_id'); } @@ -58,7 +71,7 @@ public function child() /** * Get the children items. */ - public function children() + public function children(): HasMany { return $this->hasMany(self::class, 'parent_id'); } @@ -70,4 +83,14 @@ public function getTypeAttribute() { return $this->order_item->type; } + + /** + * Create a new factory instance for the model. + * + * @return InvoiceItemFactory + */ + protected static function newFactory(): InvoiceItemFactory + { + return InvoiceItemFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/Order.php b/packages/Webkul/Sales/src/Models/Order.php index e9df0aecdad..2b21ba4f4d6 100755 --- a/packages/Webkul/Sales/src/Models/Order.php +++ b/packages/Webkul/Sales/src/Models/Order.php @@ -5,15 +5,29 @@ use Webkul\Checkout\Models\CartProxy; use Illuminate\Database\Eloquent\Model; use Webkul\Sales\Contracts\Order as OrderContract; +use Webkul\Sales\Database\Factories\OrderFactory; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Order extends Model implements OrderContract { + use HasFactory; + public const STATUS_PENDING = 'pending'; + public const STATUS_PENDING_PAYMENT = 'pending_payment'; + public const STATUS_PROCESSING = 'processing'; + public const STATUS_COMPLETED = 'completed'; + public const STATUS_CANCELED = 'canceled'; + public const STATUS_CLOSED = 'closed'; + public const STATUS_FRAUD = 'fraud'; protected $guarded = [ @@ -29,19 +43,19 @@ class Order extends Model implements OrderContract ]; protected $statusLabel = [ - self::STATUS_PENDING => 'Pending', + self::STATUS_PENDING => 'Pending', self::STATUS_PENDING_PAYMENT => 'Pending Payment', - self::STATUS_PROCESSING => 'Processing', - self::STATUS_COMPLETED => 'Completed', - self::STATUS_CANCELED => 'Canceled', - self::STATUS_CLOSED => 'Closed', - self::STATUS_FRAUD => 'Fraud', + self::STATUS_PROCESSING => 'Processing', + self::STATUS_COMPLETED => 'Completed', + self::STATUS_CANCELED => 'Canceled', + self::STATUS_CLOSED => 'Closed', + self::STATUS_FRAUD => 'Fraud', ]; /** * Get the order items record associated with the order. */ - public function getCustomerFullNameAttribute() + public function getCustomerFullNameAttribute(): string { return $this->customer_first_name . ' ' . $this->customer_last_name; } @@ -73,7 +87,7 @@ public function getTotalDueAttribute() /** * Get the associated cart that was used to create this order. */ - public function cart() + public function cart(): BelongsTo { return $this->belongsTo(CartProxy::modelClass()); } @@ -81,15 +95,16 @@ public function cart() /** * Get the order items record associated with the order. */ - public function items() + public function items(): HasMany { - return $this->hasMany(OrderItemProxy::modelClass())->whereNull('parent_id'); + return $this->hasMany(OrderItemProxy::modelClass()) + ->whereNull('parent_id'); } /** * Get the comments record associated with the order. */ - public function comments() + public function comments(): HasMany { return $this->hasMany(OrderCommentProxy::modelClass()); } @@ -97,7 +112,7 @@ public function comments() /** * Get the order items record associated with the order. */ - public function all_items() + public function all_items(): HasMany { return $this->hasMany(OrderItemProxy::modelClass()); } @@ -105,7 +120,7 @@ public function all_items() /** * Get the order shipments record associated with the order. */ - public function shipments() + public function shipments(): HasMany { return $this->hasMany(ShipmentProxy::modelClass()); } @@ -113,7 +128,7 @@ public function shipments() /** * Get the order invoices record associated with the order. */ - public function invoices() + public function invoices(): HasMany { return $this->hasMany(InvoiceProxy::modelClass()); } @@ -121,7 +136,7 @@ public function invoices() /** * Get the order refunds record associated with the order. */ - public function refunds() + public function refunds(): HasMany { return $this->hasMany(RefundProxy::modelClass()); } @@ -129,7 +144,7 @@ public function refunds() /** * Get the order transactions record associated with the order. */ - public function transactions() + public function transactions(): HasMany { return $this->hasMany(OrderTransactionProxy::modelClass()); } @@ -137,7 +152,7 @@ public function transactions() /** * Get the customer record associated with the order. */ - public function customer() + public function customer(): MorphTo { return $this->morphTo(); } @@ -145,7 +160,7 @@ public function customer() /** * Get the addresses for the order. */ - public function addresses() + public function addresses(): HasMany { return $this->hasMany(OrderAddressProxy::modelClass()); } @@ -153,17 +168,18 @@ public function addresses() /** * Get the payment for the order. */ - public function payment() + public function payment(): HasOne { return $this->hasOne(OrderPaymentProxy::modelClass()); } /** - * Get the biling address for the order. + * Get the billing address for the order. */ - public function billing_address() + public function billing_address(): HasMany { - return $this->addresses()->where('address_type', OrderAddress::ADDRESS_TYPE_BILLING); + return $this->addresses() + ->where('address_type', OrderAddress::ADDRESS_TYPE_BILLING); } /** @@ -171,15 +187,17 @@ public function billing_address() */ public function getBillingAddressAttribute() { - return $this->billing_address()->first(); + return $this->billing_address() + ->first(); } /** * Get the shipping address for the order. */ - public function shipping_address() + public function shipping_address(): HasMany { - return $this->addresses()->where('address_type', OrderAddress::ADDRESS_TYPE_SHIPPING); + return $this->addresses() + ->where('address_type', OrderAddress::ADDRESS_TYPE_SHIPPING); } /** @@ -187,7 +205,8 @@ public function shipping_address() */ public function getShippingAddressAttribute() { - return $this->shipping_address()->first(); + return $this->shipping_address() + ->first(); } /** @@ -206,7 +225,8 @@ public function channel() public function haveStockableItems(): bool { foreach ($this->items as $item) { - if ($item->getTypeInstance()->isStockable()) { + if ($item->getTypeInstance() + ->isStockable()) { return true; } } @@ -268,12 +288,13 @@ public function canCancel(): bool if ($this->payment->method == 'moneytransfer' && core()->getConfigData('sales.paymentmethods.moneytransfer.generate_invoice')) { return false; } - + if ($this->status === self::STATUS_FRAUD) { return false; } - $pendingInvoice = $this->invoices->where('state', 'pending')->first(); + $pendingInvoice = $this->invoices->where('state', 'pending') + ->first(); if ($pendingInvoice) { return true; } @@ -297,8 +318,9 @@ public function canRefund(): bool if ($this->status === self::STATUS_FRAUD) { return false; } - - $pendingInvoice = $this->invoices->where('state', 'pending')->first(); + + $pendingInvoice = $this->invoices->where('state', 'pending') + ->first(); if ($pendingInvoice) { return false; } @@ -309,10 +331,21 @@ public function canRefund(): bool } } - if ($this->base_grand_total_invoiced - $this->base_grand_total_refunded - $this->refunds()->sum('base_adjustment_fee') > 0) { + if ($this->base_grand_total_invoiced - $this->base_grand_total_refunded - $this->refunds() + ->sum('base_adjustment_fee') > 0) { return true; } return false; } + + /** + * Create a new factory instance for the model. + * + * @return OrderFactory + */ + protected static function newFactory(): OrderFactory + { + return OrderFactory::new(); + } } diff --git a/packages/Webkul/Sales/src/Models/OrderAddress.php b/packages/Webkul/Sales/src/Models/OrderAddress.php index a8a63f700d0..6ba8197d594 100755 --- a/packages/Webkul/Sales/src/Models/OrderAddress.php +++ b/packages/Webkul/Sales/src/Models/OrderAddress.php @@ -4,20 +4,27 @@ use Webkul\Checkout\Models\CartAddress; use Webkul\Core\Models\Address; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Sales\Database\Factories\OrderAddressFactory; use Webkul\Sales\Contracts\OrderAddress as OrderAddressContract; use Illuminate\Database\Eloquent\Builder; /** * Class OrderAddress + * * @package Webkul\Sales\Models * * @property integer $order_id - * @property Order $order + * @property Order $order * */ class OrderAddress extends Address implements OrderAddressContract { + use HasFactory; + public const ADDRESS_TYPE_SHIPPING = 'order_shipping'; + public const ADDRESS_TYPE_BILLING = 'order_billing'; /** @@ -32,12 +39,12 @@ class OrderAddress extends Address implements OrderAddressContract * * @return void */ - protected static function boot() + protected static function boot(): void { static::addGlobalScope('address_type', function (Builder $builder) { $builder->whereIn('address_type', [ self::ADDRESS_TYPE_BILLING, - self::ADDRESS_TYPE_SHIPPING + self::ADDRESS_TYPE_SHIPPING, ]); }); @@ -58,8 +65,18 @@ protected static function boot() /** * Get the order record associated with the address. */ - public function order() + public function order(): BelongsTo { return $this->belongsTo(Order::class); } + + /** + * Create a new factory instance for the model. + * + * @return OrderAddressFactory + */ + protected static function newFactory(): OrderAddressFactory + { + return OrderAddressFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/OrderItem.php b/packages/Webkul/Sales/src/Models/OrderItem.php index cfd479d4e65..9feaaed6e5e 100755 --- a/packages/Webkul/Sales/src/Models/OrderItem.php +++ b/packages/Webkul/Sales/src/Models/OrderItem.php @@ -2,12 +2,20 @@ namespace Webkul\Sales\Models; +use Webkul\Product\Type\AbstractType; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Webkul\Sales\Database\Factories\OrderItemFactory; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Webkul\Sales\Contracts\OrderItem as OrderItemContract; -use Webkul\Product\Models\Product; class OrderItem extends Model implements OrderItemContract { + use HasFactory; + protected $guarded = [ 'id', 'child', @@ -27,7 +35,7 @@ class OrderItem extends Model implements OrderItemContract * * @return AbstractType */ - public function getTypeInstance() + public function getTypeInstance(): AbstractType { if ($this->typeInstance) { return $this->typeInstance; @@ -45,17 +53,18 @@ public function getTypeInstance() /** * @return bool */ - public function isStockable() + public function isStockable(): bool { - return $this->getTypeInstance()->isStockable(); + return $this->getTypeInstance() + ->isStockable(); } /** - * Checks if new shipment is allow or not + * Checks if new shipment is allowed or not */ - public function canShip() + public function canShip(): bool { - if (! $this->isStockable()) { + if (!$this->isStockable()) { return false; } @@ -71,7 +80,7 @@ public function canShip() */ public function getQtyToShipAttribute() { - if (! $this->isStockable()) { + if (!$this->isStockable()) { return 0; } @@ -101,13 +110,9 @@ public function getQtyToInvoiceAttribute() /** * Checks if new cancel is allow or not */ - public function canCancel() + public function canCancel(): bool { - if ($this->qty_to_cancel > 0) { - return true; - } - - return false; + return $this->qty_to_cancel > 0; } /** @@ -129,7 +134,7 @@ public function getQtyToRefundAttribute() /** * Get the order record associated with the order item. */ - public function order() + public function order(): BelongsTo { return $this->belongsTo(OrderProxy::modelClass()); } @@ -137,7 +142,7 @@ public function order() /** * Get the product record associated with the order item. */ - public function product() + public function product(): MorphTo { return $this->morphTo(); } @@ -145,7 +150,7 @@ public function product() /** * Get the child item record associated with the order item. */ - public function child() + public function child(): HasOne { return $this->hasOne(OrderItemProxy::modelClass(), 'parent_id'); } @@ -153,7 +158,7 @@ public function child() /** * Get the parent item record associated with the order item. */ - public function parent() + public function parent(): BelongsTo { return $this->belongsTo(self::class, 'parent_id'); } @@ -161,7 +166,7 @@ public function parent() /** * Get the children items. */ - public function children() + public function children(): HasMany { return $this->hasMany(self::class, 'parent_id'); } @@ -169,7 +174,7 @@ public function children() /** * Get the invoice items record associated with the order item. */ - public function invoice_items() + public function invoice_items(): HasMany { return $this->hasMany(InvoiceItemProxy::modelClass()); } @@ -177,7 +182,7 @@ public function invoice_items() /** * Get the shipment items record associated with the order item. */ - public function shipment_items() + public function shipment_items(): HasMany { return $this->hasMany(ShipmentItemProxy::modelClass()); } @@ -185,7 +190,7 @@ public function shipment_items() /** * Get the refund items record associated with the order item. */ - public function refund_items() + public function refund_items(): HasMany { return $this->hasMany(RefundItemProxy::modelClass()); } @@ -193,7 +198,7 @@ public function refund_items() /** * Returns configurable option html */ - public function downloadable_link_purchased() + public function downloadable_link_purchased(): HasMany { return $this->hasMany(DownloadableLinkPurchasedProxy::modelClass()); } @@ -201,7 +206,7 @@ public function downloadable_link_purchased() /** * @return array */ - public function toArray() + public function toArray(): array { $array = parent::toArray(); @@ -217,4 +222,14 @@ public function toArray() return $array; } + + /** + * Create a new factory instance for the model. + * + * @return OrderItemFactory + */ + protected static function newFactory(): OrderItemFactory + { + return OrderItemFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/OrderPayment.php b/packages/Webkul/Sales/src/Models/OrderPayment.php index 23eeccd5f2d..495013e1e7e 100755 --- a/packages/Webkul/Sales/src/Models/OrderPayment.php +++ b/packages/Webkul/Sales/src/Models/OrderPayment.php @@ -3,10 +3,14 @@ namespace Webkul\Sales\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Webkul\Sales\Database\Factories\OrderPaymentFactory; use Webkul\Sales\Contracts\OrderPayment as OrderPaymentContract; class OrderPayment extends Model implements OrderPaymentContract { + use HasFactory; + protected $table = 'order_payment'; protected $guarded = [ @@ -16,6 +20,16 @@ class OrderPayment extends Model implements OrderPaymentContract ]; protected $casts = [ - 'additional' => 'array' + 'additional' => 'array', ]; + + /** + * Create a new factory instance for the model. + * + * @return OrderPaymentFactory + */ + protected static function newFactory(): OrderPaymentFactory + { + return OrderPaymentFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/Refund.php b/packages/Webkul/Sales/src/Models/Refund.php index fa70bbc2334..d40142607f8 100644 --- a/packages/Webkul/Sales/src/Models/Refund.php +++ b/packages/Webkul/Sales/src/Models/Refund.php @@ -3,31 +3,37 @@ namespace Webkul\Sales\Models; use Illuminate\Database\Eloquent\Model; +use Webkul\Sales\Database\Factories\RefundFactory; use Webkul\Sales\Contracts\Refund as RefundContract; +use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; class Refund extends Model implements RefundContract { + use HasFactory; + protected $guarded = [ 'id', 'created_at', 'updated_at', ]; - protected $statusLabel = [ - ]; + protected $statusLabel = []; /** * Returns the status label from status code */ public function getStatusLabelAttribute() { - return isset($this->statusLabel[$this->state]) ? $this->statusLabel[$this->state] : ''; + return $this->statusLabel[$this->state] ?? ''; } /** * Get the order that belongs to the Refund. */ - public function order() + public function order(): BelongsTo { return $this->belongsTo(OrderProxy::modelClass()); } @@ -35,14 +41,16 @@ public function order() /** * Get the Refund items record associated with the Refund. */ - public function items() { - return $this->hasMany(RefundItemProxy::modelClass())->whereNull('parent_id'); + public function items(): HasMany + { + return $this->hasMany(RefundItemProxy::modelClass()) + ->whereNull('parent_id'); } /** * Get the customer record associated with the Refund. */ - public function customer() + public function customer(): MorphTo { return $this->morphTo(); } @@ -50,7 +58,7 @@ public function customer() /** * Get the channel record associated with the Refund. */ - public function channel() + public function channel(): MorphTo { return $this->morphTo(); } @@ -58,8 +66,18 @@ public function channel() /** * Get the addresses for the shipment. */ - public function address() + public function address(): BelongsTo { return $this->belongsTo(OrderAddressProxy::modelClass(), 'order_address_id'); } + + /** + * Create a new factory instance for the model. + * + * @return RefundFactory + */ + protected static function newFactory(): RefundFactory + { + return RefundFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Models/Shipment.php b/packages/Webkul/Sales/src/Models/Shipment.php index 8dc2cbb87e5..cf8233ec60e 100755 --- a/packages/Webkul/Sales/src/Models/Shipment.php +++ b/packages/Webkul/Sales/src/Models/Shipment.php @@ -4,10 +4,17 @@ use Illuminate\Database\Eloquent\Model; use Webkul\Inventory\Models\InventorySource; +use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Webkul\Sales\Database\Factories\ShipmentFactory; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Webkul\Sales\Contracts\Shipment as ShipmentContract; class Shipment extends Model implements ShipmentContract { + use HasFactory; + protected $guarded = [ 'id', 'created_at', @@ -17,7 +24,7 @@ class Shipment extends Model implements ShipmentContract /** * Get the order that belongs to the invoice. */ - public function order() + public function order(): BelongsTo { return $this->belongsTo(OrderProxy::modelClass()); } @@ -25,7 +32,7 @@ public function order() /** * Get the shipment items record associated with the shipment. */ - public function items() + public function items(): HasMany { return $this->hasMany(ShipmentItemProxy::modelClass()); } @@ -33,7 +40,7 @@ public function items() /** * Get the inventory source associated with the shipment. */ - public function inventory_source() + public function inventory_source(): BelongsTo { return $this->belongsTo(InventorySource::class, 'inventory_source_id'); } @@ -41,7 +48,7 @@ public function inventory_source() /** * Get the customer record associated with the shipment. */ - public function customer() + public function customer(): MorphTo { return $this->morphTo(); } @@ -49,9 +56,19 @@ public function customer() /** * Get the address for the shipment. */ - public function address() + public function address(): BelongsTo { return $this->belongsTo(OrderAddressProxy::modelClass(), 'order_address_id') - ->where('address_type', OrderAddress::ADDRESS_TYPE_SHIPPING); + ->where('address_type', OrderAddress::ADDRESS_TYPE_SHIPPING); + } + + /** + * Create a new factory instance for the model. + * + * @return ShipmentFactory + */ + protected static function newFactory(): ShipmentFactory + { + return ShipmentFactory::new(); } } \ No newline at end of file diff --git a/packages/Webkul/Sales/src/Providers/SalesServiceProvider.php b/packages/Webkul/Sales/src/Providers/SalesServiceProvider.php index a3d2a60038a..25faf9ba5f5 100755 --- a/packages/Webkul/Sales/src/Providers/SalesServiceProvider.php +++ b/packages/Webkul/Sales/src/Providers/SalesServiceProvider.php @@ -2,12 +2,11 @@ namespace Webkul\Sales\Providers; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; use Illuminate\Support\ServiceProvider; class SalesServiceProvider extends ServiceProvider { - public function boot() + public function boot(): void { $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); } @@ -16,27 +15,9 @@ public function boot() * Register services. * * @return void - * @throws \Illuminate\Contracts\Container\BindingResolutionException */ - public function register() + public function register(): void { - $this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories'); - - $this->mergeConfigFrom( - dirname(__DIR__) . '/Config/system.php', 'core' - ); - } - - /** - * Register factories. - * - * @param string $path - * - * @return void - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function registerEloquentFactoriesFrom($path): void - { - $this->app->make(EloquentFactory::class)->load($path); + $this->mergeConfigFrom(dirname(__DIR__) . '/Config/system.php', 'core'); } } \ No newline at end of file diff --git a/packages/Webkul/Tax/src/Database/Factories/TaxCategoryFactory.php b/packages/Webkul/Tax/src/Database/Factories/TaxCategoryFactory.php index a0aab3cab04..21fd80b274b 100644 --- a/packages/Webkul/Tax/src/Database/Factories/TaxCategoryFactory.php +++ b/packages/Webkul/Tax/src/Database/Factories/TaxCategoryFactory.php @@ -1,14 +1,30 @@ define(TaxCategory::class, function (Faker $faker) { - return [ - 'code' => $faker->uuid, - 'name' => $faker->words(2, true), - 'description' => $faker->sentence(10), - ]; -}); +class TaxCategoryFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = TaxCategory::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'code' => $this->faker->uuid, + 'name' => $this->faker->words(2, true), + 'description' => $this->faker->sentence(10), + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Tax/src/Database/Factories/TaxMapFactory.php b/packages/Webkul/Tax/src/Database/Factories/TaxMapFactory.php index 7e7d507690f..a8cb272ee77 100644 --- a/packages/Webkul/Tax/src/Database/Factories/TaxMapFactory.php +++ b/packages/Webkul/Tax/src/Database/Factories/TaxMapFactory.php @@ -1,19 +1,32 @@ TaxCategory::factory(), + 'tax_rate_id' => TaxRate::factory(), + ]; + } +} -$factory->define(TaxMap::class, function (Faker $faker) { - return [ - 'tax_category_id' => function () { - return factory(TaxCategory::class)->create()->id; - }, - 'tax_rate_id' => function () { - return factory(TaxRate::class)->create()->id; - }, - ]; -}); diff --git a/packages/Webkul/Tax/src/Database/Factories/TaxRateFactory.php b/packages/Webkul/Tax/src/Database/Factories/TaxRateFactory.php index a611bebc09c..a37c9eaa110 100644 --- a/packages/Webkul/Tax/src/Database/Factories/TaxRateFactory.php +++ b/packages/Webkul/Tax/src/Database/Factories/TaxRateFactory.php @@ -1,19 +1,35 @@ define(TaxRate::class, function (Faker $faker) { - return [ - 'identifier' => $faker->uuid, - 'is_zip' => 0, - 'zip_code' => '*', - 'zip_from' => null, - 'zip_to' => null, - 'state' => '', - 'country' => $faker->countryCode, - 'tax_rate' => $faker->randomFloat(2, 3, 25), - ]; -}); +class TaxRateFactory extends Factory +{ + /** + * The name of the factory's corresponding model. + * + * @var string + */ + protected $model = TaxRate::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'identifier' => $this->faker->uuid, + 'is_zip' => 0, + 'zip_code' => '*', + 'zip_from' => null, + 'zip_to' => null, + 'state' => '', + 'country' => $this->faker->countryCode, + 'tax_rate' => $this->faker->randomFloat(2, 3, 25), + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Tax/src/Models/TaxCategory.php b/packages/Webkul/Tax/src/Models/TaxCategory.php index 011e37106b7..7ef06525271 100755 --- a/packages/Webkul/Tax/src/Models/TaxCategory.php +++ b/packages/Webkul/Tax/src/Models/TaxCategory.php @@ -3,10 +3,15 @@ namespace Webkul\Tax\Models; use Illuminate\Database\Eloquent\Model; +use Webkul\Tax\Database\Factories\TaxCategoryFactory; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Webkul\Tax\Contracts\TaxCategory as TaxCategoryContract; class TaxCategory extends Model implements TaxCategoryContract { + use HasFactory; + /** * The attributes that are mass assignable. * @@ -16,14 +21,25 @@ class TaxCategory extends Model implements TaxCategoryContract protected $table = 'tax_categories'; protected $fillable = [ - 'code', - 'name', - 'description', + 'code', + 'name', + 'description', ]; //for joining the two way pivot table - public function tax_rates() + public function tax_rates(): BelongsToMany + { + return $this->belongsToMany(TaxRateProxy::modelClass(), 'tax_categories_tax_rates', 'tax_category_id') + ->withPivot('id'); + } + + /** + * Create a new factory instance for the model. + * + * @return TaxCategoryFactory + */ + protected static function newFactory(): TaxCategoryFactory { - return $this->belongsToMany(TaxRateProxy::modelClass(), 'tax_categories_tax_rates', 'tax_category_id')->withPivot('id'); + return TaxCategoryFactory::new(); } } \ No newline at end of file diff --git a/packages/Webkul/Tax/src/Models/TaxMap.php b/packages/Webkul/Tax/src/Models/TaxMap.php index a74c5fa1f54..650e6c07b22 100755 --- a/packages/Webkul/Tax/src/Models/TaxMap.php +++ b/packages/Webkul/Tax/src/Models/TaxMap.php @@ -3,12 +3,14 @@ namespace Webkul\Tax\Models; use Illuminate\Database\Eloquent\Model; -use Webkul\Tax\Models\TaxCategory; -use Webkul\Tax\Models\TaxRate; +use Webkul\Tax\Database\Factories\TaxMapFactory; use Webkul\Tax\Contracts\TaxMap as TaxMapContract; +use Illuminate\Database\Eloquent\Factories\HasFactory; class TaxMap extends Model implements TaxMapContract { + use HasFactory; + /** * The attributes that are mass assignable. * @@ -22,4 +24,13 @@ class TaxMap extends Model implements TaxMapContract 'tax_rate_id', ]; + /** + * Create a new factory instance for the model. + * + * @return TaxMapFactory + */ + protected static function newFactory(): TaxMapFactory + { + return TaxMapFactory::new(); + } } \ No newline at end of file diff --git a/packages/Webkul/Tax/src/Models/TaxRate.php b/packages/Webkul/Tax/src/Models/TaxRate.php index 404d4a15408..4e4b34b410a 100755 --- a/packages/Webkul/Tax/src/Models/TaxRate.php +++ b/packages/Webkul/Tax/src/Models/TaxRate.php @@ -3,11 +3,15 @@ namespace Webkul\Tax\Models; use Illuminate\Database\Eloquent\Model; -use Webkul\Tax\Models\TaxCategory; +use Webkul\Tax\Database\Factories\TaxRateFactory; use Webkul\Tax\Contracts\TaxRate as TaxRateContract; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; class TaxRate extends Model implements TaxRateContract { + use HasFactory; + /** * The attributes that are mass assignable. * @@ -27,8 +31,18 @@ class TaxRate extends Model implements TaxRateContract 'tax_rate', ]; - public function tax_categories() + public function tax_categories(): BelongsToMany { return $this->belongsToMany(TaxCategoryProxy::modelClass(), 'tax_categories_tax_rates', 'tax_rate_id', 'id'); } + + /** + * Create a new factory instance for the model. + * + * @return TaxRateFactory + */ + protected static function newFactory(): TaxRateFactory + { + return TaxRateFactory::new(); + } } \ No newline at end of file diff --git a/tests/trigger.suite.yml b/tests/trigger.suite.yml index c87ec0a961e..77d44fee3a7 100644 --- a/tests/trigger.suite.yml +++ b/tests/trigger.suite.yml @@ -8,7 +8,7 @@ modules: - Asserts - Filesystem - \Helper\Unit - - Laravel5: + - Laravel: environment_file: .env.testing run_database_migrations: true run_database_seeder: true diff --git a/tests/trigger/Shop/DatabaseLogicCest.php b/tests/trigger/Shop/DatabaseLogicCest.php index 4b640e12716..b325f13f196 100644 --- a/tests/trigger/Shop/DatabaseLogicCest.php +++ b/tests/trigger/Shop/DatabaseLogicCest.php @@ -15,6 +15,7 @@ class DatabaseLogicCest /** @var Locale $localeEn */ private $localeEn; + /** @var Locale $localeDe */ private $localeDe; @@ -40,6 +41,7 @@ public function testGetUrlPathOfCategory(UnitTester $I) 'slug' => 'root', 'locale' => 'en', ]); + $rootCategory = $I->grabRecord(Category::class, [ 'id' => $rootCategoryTranslation->category_id, ]); @@ -47,9 +49,9 @@ public function testGetUrlPathOfCategory(UnitTester $I) $parentCategoryName = $this->faker->word; $parentCategoryAttributes = [ - 'parent_id' => $rootCategory->id, - 'position' => 1, - 'status' => 1, + 'parent_id' => $rootCategory->id, + 'position' => 1, + 'status' => 1, $this->localeEn->code => [ 'name' => $parentCategoryName, 'slug' => strtolower($parentCategoryName), @@ -64,15 +66,16 @@ public function testGetUrlPathOfCategory(UnitTester $I) ], ]; - $parentCategory = $I->make(Category::class, $parentCategoryAttributes)->first(); + $parentCategory = $I->make(Category::class, $parentCategoryAttributes) + ->first(); $rootCategory->prependNode($parentCategory); $I->assertNotNull($parentCategory); $categoryName = $this->faker->word; $categoryAttributes = [ - 'position' => 1, - 'status' => 1, - 'parent_id' => $parentCategory->id, + 'position' => 1, + 'status' => 1, + 'parent_id' => $parentCategory->id, $this->localeEn->code => [ 'name' => $categoryName, 'slug' => strtolower($categoryName), @@ -87,7 +90,8 @@ public function testGetUrlPathOfCategory(UnitTester $I) ], ]; - $category = $I->make(Category::class, $categoryAttributes)->first(); + $category = $I->make(Category::class, $categoryAttributes) + ->first(); $parentCategory->prependNode($category); $I->assertNotNull($category); @@ -110,16 +114,17 @@ public function testGetUrlPathOfCategory(UnitTester $I) $I->assertEquals($expectedUrlPath, $urlPathQueryResult->url_path); $root2Category = $I->make(Category::class, [ - 'position' => 1, - 'status' => 1, - 'parent_id' => null, + 'position' => 1, + 'status' => 1, + 'parent_id' => null, $this->localeEn->code => [ 'name' => $this->faker->word, 'slug' => strtolower($this->faker->word), 'description' => $this->faker->word, 'locale_id' => $this->localeEn->id, ], - ])->first(); + ]) + ->first(); $root2Category->save(); $I->assertNull($root2Category->refresh()->parent_id); diff --git a/tests/trigger/Shop/TriggerCest.php b/tests/trigger/Shop/TriggerCest.php index 704a08fb6f3..d60505071b9 100644 --- a/tests/trigger/Shop/TriggerCest.php +++ b/tests/trigger/Shop/TriggerCest.php @@ -13,23 +13,33 @@ class TriggerCest private $faker; private $parentCategory; + private $category; + private $root2Category; + private $childOfRoot2Category; private $parentCategoryAttributes; + private $categoryAttributes; + private $root2CategoryAttributes; + private $childOfRoot2CategoryAttributes; private $parentCategoryName; + private $categoryName; + private $root2CategoryName; + private $childOfRoot2CategoryName; /** @var Locale $localeEn */ private $localeEn; + /** @var Locale $localeDe */ private $localeDe; @@ -59,9 +69,9 @@ public function _before(UnitTester $I) ]); $this->parentCategoryAttributes = [ - 'parent_id' => $rootCategory->id, - 'position' => 1, - 'status' => 1, + 'parent_id' => $rootCategory->id, + 'position' => 1, + 'status' => 1, $this->localeEn->code => [ 'name' => $this->parentCategoryName, 'slug' => strtolower($this->parentCategoryName), @@ -76,14 +86,15 @@ public function _before(UnitTester $I) ], ]; - $this->parentCategory = $I->make(Category::class, $this->parentCategoryAttributes)->first(); + $this->parentCategory = $I->make(Category::class, $this->parentCategoryAttributes) + ->first(); $rootCategory->appendNode($this->parentCategory); $I->assertNotNull($this->parentCategory); $this->categoryAttributes = [ - 'position' => 1, - 'status' => 1, - 'parent_id' => $this->parentCategory->id, + 'position' => 1, + 'status' => 1, + 'parent_id' => $this->parentCategory->id, $this->localeEn->code => [ 'name' => $this->categoryName, 'slug' => strtolower($this->categoryName), @@ -98,15 +109,16 @@ public function _before(UnitTester $I) ], ]; - $this->category = $I->make(Category::class, $this->categoryAttributes)->first(); + $this->category = $I->make(Category::class, $this->categoryAttributes) + ->first(); $this->parentCategory->appendNode($this->category); $I->assertNotNull($this->category); $this->root2CategoryAttributes = [ - 'position' => 1, - 'status' => 1, - 'parent_id' => null, + 'position' => 1, + 'status' => 1, + 'parent_id' => null, $this->localeEn->code => [ 'name' => $this->root2CategoryName, 'slug' => strtolower($this->root2CategoryName), @@ -121,7 +133,8 @@ public function _before(UnitTester $I) ], ]; - $this->root2Category = $I->make(Category::class, $this->root2CategoryAttributes)->first(); + $this->root2Category = $I->make(Category::class, $this->root2CategoryAttributes) + ->first(); $this->root2Category->save(); $I->assertNotNull($this->root2Category); @@ -129,9 +142,9 @@ public function _before(UnitTester $I) $I->assertGreaterThan($rootCategory->_rgt, $this->root2Category->_lft); $this->childOfRoot2CategoryAttributes = [ - 'position' => 1, - 'status' => 1, - 'parent_id' => $this->root2Category->id, + 'position' => 1, + 'status' => 1, + 'parent_id' => $this->root2Category->id, $this->localeEn->code => [ 'name' => $this->childOfRoot2CategoryName, 'slug' => strtolower($this->childOfRoot2CategoryName), @@ -146,7 +159,8 @@ public function _before(UnitTester $I) ], ]; - $this->childOfRoot2Category = $I->make(Category::class, $this->childOfRoot2CategoryAttributes)->first(); + $this->childOfRoot2Category = $I->make(Category::class, $this->childOfRoot2CategoryAttributes) + ->first(); $this->root2Category->appendNode($this->childOfRoot2Category); $I->assertNotNull($this->childOfRoot2Category); @@ -158,26 +172,26 @@ public function testInsertTriggerOnCategoryTranslationsTable(UnitTester $I) 'category_id' => $this->parentCategory->id, 'name' => $this->parentCategoryName, 'locale' => $this->localeEn->code, - 'url_path' => strtolower($this->parentCategoryName) + 'url_path' => strtolower($this->parentCategoryName), ]); $I->seeRecord(CategoryTranslation::class, [ 'category_id' => $this->parentCategory->id, 'name' => $this->parentCategoryName, 'locale' => $this->localeDe->code, - 'url_path' => strtolower($this->parentCategoryName) + 'url_path' => strtolower($this->parentCategoryName), ]); $I->seeRecord(CategoryTranslation::class, [ 'category_id' => $this->category->id, 'name' => $this->categoryName, 'locale' => $this->localeEn->code, - 'url_path' => strtolower($this->parentCategoryName) . '/' . strtolower($this->categoryName) + 'url_path' => strtolower($this->parentCategoryName) . '/' . strtolower($this->categoryName), ]); $I->seeRecord(CategoryTranslation::class, [ 'category_id' => $this->category->id, 'name' => $this->categoryName, 'locale' => $this->localeDe->code, - 'url_path' => strtolower($this->parentCategoryName) . '/' . strtolower($this->categoryName) + 'url_path' => strtolower($this->parentCategoryName) . '/' . strtolower($this->categoryName), ]); $I->seeRecord(CategoryTranslation::class, [ 'category_id' => $this->root2Category->id, @@ -190,13 +204,13 @@ public function testInsertTriggerOnCategoryTranslationsTable(UnitTester $I) 'category_id' => $this->childOfRoot2Category->id, 'name' => $this->childOfRoot2CategoryName, 'locale' => $this->localeDe->code, - 'url_path' => strtolower($this->childOfRoot2CategoryName) + 'url_path' => strtolower($this->childOfRoot2CategoryName), ]); $I->seeRecord(CategoryTranslation::class, [ 'category_id' => $this->childOfRoot2Category->id, 'name' => $this->childOfRoot2CategoryName, 'locale' => $this->localeEn->code, - 'url_path' => strtolower($this->childOfRoot2CategoryName) + 'url_path' => strtolower($this->childOfRoot2CategoryName), ]); } @@ -295,9 +309,7 @@ public function testUpdateTriggersOnCategoriesTable(UnitTester $I) $I->assertTrue($this->category->update($this->categoryAttributes)); $this->category->refresh(); - $expectedUrlPath = strtolower($this->parentCategoryName) . '/' - . strtolower($category2Name) . '/' - . strtolower($this->categoryName); + $expectedUrlPath = strtolower($this->parentCategoryName) . '/' . strtolower($category2Name) . '/' . strtolower($this->categoryName); $I->seeRecord(CategoryTranslation::class, [ 'category_id' => $this->category->id, 'name' => $this->categoryName, diff --git a/tests/unit/CartRule/CartRuleCest.php b/tests/unit/CartRule/CartRuleCest.php index 78924a86c9d..57a77d961db 100644 --- a/tests/unit/CartRule/CartRuleCest.php +++ b/tests/unit/CartRule/CartRuleCest.php @@ -13,6 +13,7 @@ use Webkul\Core\Helpers\Laravel5Helper; use Webkul\Customer\Models\Customer; use Webkul\Customer\Models\CustomerAddress; +use Illuminate\Contracts\Support\Arrayable; use Webkul\Product\Repositories\ProductDownloadableLinkRepository; use Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository; use Webkul\Sales\Repositories\OrderItemRepository; @@ -25,6 +26,7 @@ class cartRuleWithCoupon { public $cartRule; + public $coupon; public function __construct(CartRule $cartRule, CartRuleCoupon $coupon) @@ -34,25 +36,40 @@ public function __construct(CartRule $cartRule, CartRuleCoupon $coupon) } } -class expectedCartItem +class expectedCartItem implements Arrayable { public const ITEM_DISCOUNT_AMOUNT_PRECISION = 4; + public const ITEM_TAX_AMOUNT_PRECISION = 4; public $cart_id; + public $product_id; + public $quantity = 1; + public $price = 0.0; + public $base_price = 0.0; + public $total = 0.0; + public $base_total = 0.0; + public $tax_percent = 0.0; + public $tax_amount = 0.0; + public $base_tax_amount = 0.0; + public $coupon_code = null; + public $discount_percent = 0.0; + public $discount_amount = 0.0; + public $base_discount_amount = 0.0; + public $applied_cart_rule_ids = ''; public function __construct(int $cartId, int $productId) @@ -69,14 +86,8 @@ public function calcTotals(): void public function calcTaxAmounts(): void { - $this->tax_amount = round( - $this->quantity * $this->price * $this->tax_percent / 100, - self::ITEM_TAX_AMOUNT_PRECISION - ); - $this->base_tax_amount = round( - $this->quantity * $this->price * $this->tax_percent / 100, - self::ITEM_TAX_AMOUNT_PRECISION - ); + $this->tax_amount = round($this->quantity * $this->price * $this->tax_percent / 100, self::ITEM_TAX_AMOUNT_PRECISION); + $this->base_tax_amount = round($this->quantity * $this->price * $this->tax_percent / 100, self::ITEM_TAX_AMOUNT_PRECISION); } public function calcFixedDiscountAmounts(float $discount, float $baseDiscount, string $code, int $cartRuleId): void @@ -90,17 +101,32 @@ public function calcFixedDiscountAmounts(float $discount, float $baseDiscount, s public function calcPercentageDiscountAmounts(float $discount, string $code, int $cartRuleId): void { $this->discount_percent = $discount; - $this->discount_amount = round( - ($this->total + $this->tax_amount) * $this->discount_percent / 100, - self::ITEM_DISCOUNT_AMOUNT_PRECISION - ); - $this->base_discount_amount = round( - ($this->base_total + $this->base_tax_amount) * $this->discount_percent / 100, - self::ITEM_DISCOUNT_AMOUNT_PRECISION - ); + $this->discount_amount = round(($this->total + $this->tax_amount) * $this->discount_percent / 100, self::ITEM_DISCOUNT_AMOUNT_PRECISION); + $this->base_discount_amount = round(($this->base_total + $this->base_tax_amount) * $this->discount_percent / 100, self::ITEM_DISCOUNT_AMOUNT_PRECISION); $this->coupon_code = $code; $this->applied_cart_rule_ids = (string)$cartRuleId; } + + public function toArray(): array + { + return [ + 'cart_id' => $this->cart_id, + 'product_id' => $this->product_id, + 'quantity' => $this->quantity, + 'price' => $this->price, + 'base_price' => $this->base_price, + 'total' => $this->total, + 'base_total' => $this->base_total, + 'tax_percent' => $this->tax_percent, + 'tax_amount' => $this->tax_amount, + 'base_tax_amount' => $this->base_tax_amount, + 'coupon_code' => $this->coupon_code, + 'discount_percent' => $this->discount_percent, + 'discount_amount' => $this->discount_amount, + 'base_discount_amount' => $this->base_discount_amount, + 'applied_cart_rule_ids' => $this->applied_cart_rule_ids, + ]; + } } class expectedCart @@ -108,18 +134,31 @@ class expectedCart public const CART_TOTAL_PRECISION = 2; public $customer_id; + public $id; + public $items_count = 0; + public $items_qty = 0.0; + public $sub_total = 0.0; + public $tax_total = 0.0; + public $discount_amount = 0.0; + public $grand_total = 0.0; + public $base_sub_total = 0.0; + public $base_tax_total = 0.0; + public $base_discount_amount = 0.0; + public $base_grand_total = 0.0; + public $coupon_code = null; + public $applied_cart_rule_ids = ''; public function __construct(int $cartId, int $customerId) @@ -139,14 +178,12 @@ public function finalizeTotals(): void $this->sub_total = round($this->sub_total, self::CART_TOTAL_PRECISION); $this->tax_total = round($this->tax_total, self::CART_TOTAL_PRECISION); $this->discount_amount = round($this->discount_amount, self::CART_TOTAL_PRECISION); - $this->grand_total = round($this->sub_total + $this->tax_total - $this->discount_amount, - self::CART_TOTAL_PRECISION); + $this->grand_total = round($this->sub_total + $this->tax_total - $this->discount_amount, self::CART_TOTAL_PRECISION); $this->base_sub_total = round($this->base_sub_total, self::CART_TOTAL_PRECISION); $this->base_tax_total = round($this->base_tax_total, self::CART_TOTAL_PRECISION); $this->base_discount_amount = round($this->base_discount_amount, self::CART_TOTAL_PRECISION); - $this->base_grand_total = round($this->base_sub_total + $this->base_tax_total - $this->base_discount_amount, - self::CART_TOTAL_PRECISION); + $this->base_grand_total = round($this->base_sub_total + $this->base_tax_total - $this->base_discount_amount, self::CART_TOTAL_PRECISION); } public function toArray(): array @@ -155,29 +192,50 @@ public function toArray(): array } } -class expectedOrder +class expectedOrder implements Arrayable { public $status; + public $customer_email; + public $customer_first_name; + public $customer_vat_id; + public $coupon_code; + public $total_item_count; + public $total_qty_ordered; + public $grand_total; + public $base_grand_total; + public $sub_total; + public $base_sub_total; + public $discount_amount; + public $base_discount_amount; + public $tax_amount; + public $base_tax_amount; + public $customer_id; + public $cart_id; + public $applied_cart_rule_ids; + public $shipping_method; + public $shipping_amount; + public $base_shipping_amount; + public $shipping_discount_amount; public function __construct(expectedCart $expectedCart, Customer $customer, int $cartId) @@ -205,38 +263,82 @@ public function __construct(expectedCart $expectedCart, Customer $customer, int $this->base_shipping_amount = null; $this->shipping_discount_amount = null; } + + public function toArray(): array + { + return [ + 'status' => $this->status, + 'customer_email' => $this->customer_email, + 'customer_first_name' => $this->customer_first_name, + 'customer_vat_id' => $this->customer_vat_id, + 'coupon_code' => $this->coupon_code, + 'total_item_count' => $this->total_item_count, + 'total_qty_ordered' => $this->total_qty_ordered, + 'grand_total' => $this->grand_total, + 'base_grand_total' => $this->base_grand_total, + 'sub_total' => $this->sub_total, + 'base_sub_total' => $this->base_sub_total, + 'discount_amount' => $this->discount_amount, + 'base_discount_amount' => $this->base_discount_amount, + 'tax_amount' => $this->tax_amount, + 'base_tax_amount' => $this->base_tax_amount, + 'customer_id' => $this->customer_id, + 'cart_id' => $this->cart_id, + 'applied_cart_rule_ids' => $this->applied_cart_rule_ids, + 'shipping_method' => $this->shipping_method, + 'shipping_amount' => $this->shipping_amount, + 'base_shipping_amount' => $this->base_shipping_amount, + 'shipping_discount_amount' => $this->shipping_discount_amount, + ]; + } } class CartRuleCest { private $products; + private $sessionToken; public const PRODUCT_PRICE = 13.57; + public const REDUCED_PRODUCT_PRICE = 7.21; + public const TAX_RATE = 18.5; + public const REDUCED_TAX_RATE = 5.5; public const DISCOUNT_AMOUNT_FIX = 3.37; + public const DISCOUNT_AMOUNT_PERCENT = 7.5; + public const DISCOUNT_AMOUNT_FIX_FULL = 999999.99; + public const DISCOUNT_AMOUNT_CART = 8.33; public const ACTION_TYPE_FIXED = "by_fixed"; + public const ACTION_TYPE_PERCENTAGE = "by_percent"; + public const ACTION_TYPE_CART_FIXED = "cart_fixed"; public const PRODUCT_FREE = 0; + public const PRODUCT_NOT_FREE = 1; + public const PRODUCT_NOT_FREE_REDUCED_TAX = 2; public const TAX_CATEGORY = 0; + public const TAX_REDUCED_CATEGORY = 1; public const COUPON_FIXED = 0; + public const COUPON_FIXED_FULL = 1; + public const COUPON_PERCENTAGE = 2; + public const COUPON_PERCENTAGE_FULL = 3; + public const COUPON_FIXED_CART = 4; @@ -260,51 +362,51 @@ protected function getCartWithCouponScenarios(): array // ], // ohne coupon [ - 'name' => 'PRODUCT_FREE no coupon', + 'name' => 'PRODUCT_FREE no coupon', 'productSequence' => [ self::PRODUCT_FREE, ], - 'withCoupon' => false, - 'checkOrder' => false, + 'withCoupon' => false, + 'checkOrder' => false, ], [ - 'name' => 'PRODUCT_NOT_FREE no coupon', + 'name' => 'PRODUCT_NOT_FREE no coupon', 'productSequence' => [ self::PRODUCT_NOT_FREE, ], - 'withCoupon' => false, - 'checkOrder' => false, + 'withCoupon' => false, + 'checkOrder' => false, ], // fixer Coupon für ein Produkt (Warenkorb wird nicht 0) [ - 'name' => 'PRODUCT_NOT_FREE fix coupon', + 'name' => 'PRODUCT_NOT_FREE fix coupon', 'productSequence' => [ self::PRODUCT_NOT_FREE, ], - 'withCoupon' => true, - 'couponScenario' => [ + 'withCoupon' => true, + 'couponScenario' => [ 'scenario' => self::COUPON_FIXED, 'products' => [ self::PRODUCT_NOT_FREE, ], ], - 'checkOrder' => false, + 'checkOrder' => false, ], [ - 'name' => 'check fix coupon on product with quantity=2', + 'name' => 'check fix coupon on product with quantity=2', 'productSequence' => [ self::PRODUCT_NOT_FREE, self::PRODUCT_NOT_FREE_REDUCED_TAX, self::PRODUCT_NOT_FREE, ], - 'withCoupon' => true, - 'couponScenario' => [ + 'withCoupon' => true, + 'couponScenario' => [ 'scenario' => self::COUPON_FIXED, 'products' => [ self::PRODUCT_NOT_FREE, ], ], - 'checkOrder' => false, + 'checkOrder' => false, ], // [ // 'name' => 'check fix coupon applied to two products', @@ -325,34 +427,34 @@ protected function getCartWithCouponScenarios(): array // ], // prozenturaler Coupon für ein Produkt (Warenkorb wird nicht 0) [ - 'name' => 'PRODUCT_NOT_FREE percentage coupon', + 'name' => 'PRODUCT_NOT_FREE percentage coupon', 'productSequence' => [ self::PRODUCT_NOT_FREE, ], - 'withCoupon' => true, - 'couponScenario' => [ + 'withCoupon' => true, + 'couponScenario' => [ 'scenario' => self::COUPON_PERCENTAGE, 'products' => [ self::PRODUCT_NOT_FREE, ], ], - 'checkOrder' => false, + 'checkOrder' => false, ], [ - 'name' => 'check percentage coupon on product with quantity=2', + 'name' => 'check percentage coupon on product with quantity=2', 'productSequence' => [ self::PRODUCT_NOT_FREE, self::PRODUCT_NOT_FREE_REDUCED_TAX, self::PRODUCT_NOT_FREE, ], - 'withCoupon' => true, - 'couponScenario' => [ + 'withCoupon' => true, + 'couponScenario' => [ 'scenario' => self::COUPON_PERCENTAGE, 'products' => [ self::PRODUCT_NOT_FREE, ], ], - 'checkOrder' => false, + 'checkOrder' => false, ], // [ // 'name' => 'check percentage coupon applied to two products', @@ -373,34 +475,34 @@ protected function getCartWithCouponScenarios(): array // ], // fixer Coupon für ein Produkt (Warenkorb wird 0) [ - 'name' => 'PRODUCT_NON_SUB_NOT_FREE fix coupon to zero', + 'name' => 'PRODUCT_NON_SUB_NOT_FREE fix coupon to zero', 'productSequence' => [ self::PRODUCT_NOT_FREE, ], - 'withCoupon' => true, - 'couponScenario' => [ + 'withCoupon' => true, + 'couponScenario' => [ 'scenario' => self::COUPON_FIXED_FULL, 'products' => [ self::PRODUCT_NOT_FREE, ], ], - 'checkOrder' => false, + 'checkOrder' => false, ], [ - 'name' => 'check fix coupon to zero on product with quantity=2', + 'name' => 'check fix coupon to zero on product with quantity=2', 'productSequence' => [ self::PRODUCT_NOT_FREE, self::PRODUCT_NOT_FREE_REDUCED_TAX, self::PRODUCT_NOT_FREE, ], - 'withCoupon' => true, - 'couponScenario' => [ + 'withCoupon' => true, + 'couponScenario' => [ 'scenario' => self::COUPON_FIXED_FULL, 'products' => [ self::PRODUCT_NOT_FREE, ], ], - 'checkOrder' => false, + 'checkOrder' => false, ], // [ // 'name' => 'check fix coupon to zero applied to two products', @@ -421,34 +523,34 @@ protected function getCartWithCouponScenarios(): array // ], // prozenturaler Coupon für ein Produkt (Warenkorb wird 0) [ - 'name' => 'PRODUCT_NOT_FREE percentage coupon to zero', + 'name' => 'PRODUCT_NOT_FREE percentage coupon to zero', 'productSequence' => [ self::PRODUCT_NOT_FREE, ], - 'withCoupon' => true, - 'couponScenario' => [ + 'withCoupon' => true, + 'couponScenario' => [ 'scenario' => self::COUPON_PERCENTAGE_FULL, 'products' => [ self::PRODUCT_NOT_FREE, ], ], - 'checkOrder' => false, + 'checkOrder' => false, ], [ - 'name' => 'check percentage coupon to zero on product with quantity=2', + 'name' => 'check percentage coupon to zero on product with quantity=2', 'productSequence' => [ self::PRODUCT_NOT_FREE, self::PRODUCT_NOT_FREE_REDUCED_TAX, self::PRODUCT_NOT_FREE, ], - 'withCoupon' => true, - 'couponScenario' => [ + 'withCoupon' => true, + 'couponScenario' => [ 'scenario' => self::COUPON_PERCENTAGE_FULL, 'products' => [ self::PRODUCT_NOT_FREE, ], ], - 'checkOrder' => false, + 'checkOrder' => false, ], // [ // 'name' => 'check percentage coupon to zero applied to two products', @@ -471,8 +573,8 @@ protected function getCartWithCouponScenarios(): array } /** - * @param \UnitTester $I - * @param \Codeception\Example $scenario + * @param \UnitTester $I + * @param \Codeception\Example $scenario * * @dataProvider getCartWithCouponScenarios * @group slow_unit @@ -485,7 +587,9 @@ public function checkCartWithCoupon(UnitTester $I, Example $scenario): void config(['app.default_country' => 'DE']); $customer = $I->have(Customer::class); - auth()->guard('customer')->loginUsingId($customer->id); + auth() + ->guard('customer') + ->loginUsingId($customer->id); Event::dispatch('customer.after.login', $customer['email']); $this->sessionToken = $faker->uuid; @@ -501,9 +605,9 @@ public function checkCartWithCoupon(UnitTester $I, Example $scenario): void foreach ($scenario['productSequence'] as $productIndex) { $data = [ - '_token' => session('_token'), + '_token' => session('_token'), 'product_id' => $this->products[$productIndex]->id, - 'quantity' => 1, + 'quantity' => 1, ]; cart()->addProduct($this->products[$productIndex]->id, $data); @@ -512,7 +616,9 @@ public function checkCartWithCoupon(UnitTester $I, Example $scenario): void if ($scenario['withCoupon']) { $expectedCartCoupon = $cartRuleWithCoupon->coupon->code; $I->comment('I try to use coupon code ' . $expectedCartCoupon); - cart()->setCouponCode($expectedCartCoupon)->collectTotals(); + cart() + ->setCouponCode($expectedCartCoupon) + ->collectTotals(); } else { $I->comment('I have no coupon'); $expectedCartCoupon = null; @@ -525,7 +631,11 @@ public function checkCartWithCoupon(UnitTester $I, Example $scenario): void $expectedCartItems = $this->checkMaxDiscount($expectedCartItems); foreach ($expectedCartItems as $expectedCartItem) { - $I->seeRecord('cart_items', $expectedCartItem); + /** + * @var $expectedCartItem \Tests\Unit\CartRule\expectedCartItem + */ + + $I->seeRecord('cart_items', $expectedCartItem->toArray()); } $expectedCart = $this->getExpectedCart($cart->id, $expectedCartItems, $cartRuleWithCoupon); @@ -536,33 +646,33 @@ public function checkCartWithCoupon(UnitTester $I, Example $scenario): void $customerAddress = $I->have(CustomerAddress::class, [ 'first_name' => $customer->first_name, - 'last_name' => $customer->last_name, - 'country' => 'DE', + 'last_name' => $customer->last_name, + 'country' => 'DE', ]); $billing = [ - 'address1' => $customerAddress->address1, + 'address1' => $customerAddress->address1, 'use_for_shipping' => true, - 'first_name' => $customerAddress->first_name, - 'last_name' => $customerAddress->last_name, - 'email' => $customer->email, - 'company_name' => $customerAddress->company_name, - 'city' => $customerAddress->city, - 'postcode' => $customerAddress->postcode, - 'country' => $customerAddress->country, - 'state' => $customerAddress->state, - 'phone' => $customerAddress->phone, + 'first_name' => $customerAddress->first_name, + 'last_name' => $customerAddress->last_name, + 'email' => $customer->email, + 'company_name' => $customerAddress->company_name, + 'city' => $customerAddress->city, + 'postcode' => $customerAddress->postcode, + 'country' => $customerAddress->country, + 'state' => $customerAddress->state, + 'phone' => $customerAddress->phone, ]; $shipping = [ - 'address1' => '', + 'address1' => '', 'first_name' => $customerAddress->first_name, - 'last_name' => $customerAddress->last_name, - 'email' => $customer->email, + 'last_name' => $customerAddress->last_name, + 'email' => $customer->email, ]; cart()->saveCustomerAddress([ - 'billing' => $billing, + 'billing' => $billing, 'shipping' => $shipping, ]); @@ -571,15 +681,16 @@ public function checkCartWithCoupon(UnitTester $I, Example $scenario): void $I->assertFalse(cart()->hasError()); $orderItemRepository = new OrderItemRepository(app()); $downloadableLinkRepository = new ProductDownloadableLinkRepository(app()); - $downloadableLinkPurchasedRepository = - new DownloadableLinkPurchasedRepository($downloadableLinkRepository, app()); + $downloadableLinkPurchasedRepository = new DownloadableLinkPurchasedRepository($downloadableLinkRepository, app()); $orderRepository = new OrderRepository($orderItemRepository, $downloadableLinkPurchasedRepository, app()); $orderRepository->create(cart()->prepareDataForOrder()); $expectedOrder = new expectedOrder($expectedCart, $customer, $cart->id); - $I->seeRecord('orders', $expectedOrder); + $I->seeRecord('orders', $expectedOrder->toArray()); - auth()->guard('customer')->logout(); + auth() + ->guard('customer') + ->logout(); } } @@ -591,79 +702,87 @@ public function checkExampleCase(UnitTester $I) $customer = $I->have(Customer::class); - auth()->guard('customer')->loginUsingId($customer->id); + auth() + ->guard('customer') + ->loginUsingId($customer->id); Event::dispatch('customer.after.login', $customer['email']); $this->sessionToken = $faker->uuid; session(['_token' => $this->sessionToken]); $tax = $I->have(TaxRate::class, [ - 'country' => 'DE', + 'country' => 'DE', 'tax_rate' => 19.0, ]); $taxCategorie = $I->have(TaxCategory::class); $I->have(TaxMap::class, [ - 'tax_rate_id' => $tax->id, + 'tax_rate_id' => $tax->id, 'tax_category_id' => $taxCategorie->id, ]); $productConfig = [ 'attributeValues' => [ - 'price' => 23.92, + 'price' => 23.92, 'tax_category_id' => $taxCategorie->id, ], ]; $product = $I->haveProduct(Laravel5Helper::SIMPLE_PRODUCT, $productConfig); $ruleConfig = [ - 'action_type' => self::ACTION_TYPE_PERCENTAGE, + 'action_type' => self::ACTION_TYPE_PERCENTAGE, 'discount_amount' => 100, - 'conditions' => [ + 'conditions' => [ [ - 'attribute' => 'product|sku', - 'value' => $product->sku, - 'operator' => '==', + 'attribute' => 'product|sku', + 'value' => $product->sku, + 'operator' => '==', 'attribute_type' => 'text', ], ], ]; $cartRule = $I->have(CartRule::class, $ruleConfig); - DB::table('cart_rule_channels')->insert([ - 'cart_rule_id' => $cartRule->id, - 'channel_id' => core()->getCurrentChannel()->id, - ]); + DB::table('cart_rule_channels') + ->insert([ + 'cart_rule_id' => $cartRule->id, + 'channel_id' => core()->getCurrentChannel()->id, + ]); $guestCustomerGroup = $I->grabRecord('customer_groups', ['code' => 'guest']); - DB::table('cart_rule_customer_groups')->insert([ - 'cart_rule_id' => $cartRule->id, - 'customer_group_id' => $guestCustomerGroup['id'], - ]); + DB::table('cart_rule_customer_groups') + ->insert([ + 'cart_rule_id' => $cartRule->id, + 'customer_group_id' => $guestCustomerGroup['id'], + ]); $generalCustomerGroup = $I->grabRecord('customer_groups', ['code' => 'general']); - DB::table('cart_rule_customer_groups')->insert([ - 'cart_rule_id' => $cartRule->id, - 'customer_group_id' => $generalCustomerGroup['id'], - ]); + DB::table('cart_rule_customer_groups') + ->insert([ + 'cart_rule_id' => $cartRule->id, + 'customer_group_id' => $generalCustomerGroup['id'], + ]); $coupon = $I->have(CartRuleCoupon::class, [ - 'code' => 'AWESOME', + 'code' => 'AWESOME', 'cart_rule_id' => $cartRule->id, ]); $data = [ - '_token' => session('_token'), - 'product_id' => $product->id, - 'quantity' => 1, + '_token' => session('_token'), + 'product_id' => $product->id, + 'quantity' => 1, ]; cart()->addProduct($product->id, $data); - cart()->setCouponCode('AWESOME')->collectTotals(); + cart() + ->setCouponCode('AWESOME') + ->collectTotals(); $cart = cart()->getCart(); - $cartItem = $cart->items()->first(); + $cartItem = $cart->items() + ->first(); $I->assertEquals('AWESOME', $cartItem['coupon_code']); $I->assertEquals(23.92, $cartItem['price']); @@ -680,9 +799,9 @@ public function checkExampleCase(UnitTester $I) } /** - * @param \Codeception\Example $scenario - * @param \Tests\Unit\Category\cartRuleWithCoupon $cartRuleWithCoupon - * @param int $cartID + * @param \Codeception\Example $scenario + * @param \Tests\Unit\Category\cartRuleWithCoupon $cartRuleWithCoupon + * @param int $cartID * * @return array */ @@ -691,18 +810,10 @@ private function getExpectedCartItems(Example $scenario, ?cartRuleWithCoupon $ca $cartItems = []; foreach ($scenario['productSequence'] as $key => $item) { - $pos = $this->array_find( - 'product_id', - $this->products[$scenario['productSequence'][$key]]->id, - $cartItems - ); + $pos = $this->array_find('product_id', $this->products[$scenario['productSequence'][$key]]->id, $cartItems); if ($pos === null) { - $cartItem = new expectedCartItem( - $cartID, - $this->products[$scenario['productSequence'][$key]]->id - ); - + $cartItem = new expectedCartItem($cartID, $this->products[$scenario['productSequence'][$key]]->id); } else { $cartItem = $cartItems[$pos]; $cartItem->quantity++; @@ -737,12 +848,7 @@ private function getExpectedCartItems(Example $scenario, ?cartRuleWithCoupon $ca case self::COUPON_FIXED: foreach ($scenario['couponScenario']['products'] as $couponItem) { if ($item === $couponItem) { - $cartItem->calcFixedDiscountAmounts( - self::DISCOUNT_AMOUNT_FIX, - self::DISCOUNT_AMOUNT_FIX, - $cartRuleWithCoupon->coupon->code, - $cartRuleWithCoupon->cartRule->id - ); + $cartItem->calcFixedDiscountAmounts(self::DISCOUNT_AMOUNT_FIX, self::DISCOUNT_AMOUNT_FIX, $cartRuleWithCoupon->coupon->code, $cartRuleWithCoupon->cartRule->id); continue; } } @@ -751,12 +857,7 @@ private function getExpectedCartItems(Example $scenario, ?cartRuleWithCoupon $ca case self::COUPON_FIXED_FULL: foreach ($scenario['couponScenario']['products'] as $couponItem) { if ($item === $couponItem) { - $cartItem->calcFixedDiscountAmounts( - self::DISCOUNT_AMOUNT_FIX_FULL, - self::DISCOUNT_AMOUNT_FIX_FULL, - $cartRuleWithCoupon->coupon->code, - $cartRuleWithCoupon->cartRule->id - ); + $cartItem->calcFixedDiscountAmounts(self::DISCOUNT_AMOUNT_FIX_FULL, self::DISCOUNT_AMOUNT_FIX_FULL, $cartRuleWithCoupon->coupon->code, $cartRuleWithCoupon->cartRule->id); continue; } } @@ -765,11 +866,7 @@ private function getExpectedCartItems(Example $scenario, ?cartRuleWithCoupon $ca case self::COUPON_PERCENTAGE: foreach ($scenario['couponScenario']['products'] as $couponItem) { if ($item === $couponItem) { - $cartItem->calcPercentageDiscountAmounts( - self::DISCOUNT_AMOUNT_PERCENT, - $cartRuleWithCoupon->coupon->code, - $cartRuleWithCoupon->cartRule->id - ); + $cartItem->calcPercentageDiscountAmounts(self::DISCOUNT_AMOUNT_PERCENT, $cartRuleWithCoupon->coupon->code, $cartRuleWithCoupon->cartRule->id); continue; } } @@ -778,11 +875,7 @@ private function getExpectedCartItems(Example $scenario, ?cartRuleWithCoupon $ca case self::COUPON_PERCENTAGE_FULL: foreach ($scenario['couponScenario']['products'] as $couponItem) { if ($item === $couponItem) { - $cartItem->calcPercentageDiscountAmounts( - 100.0, - $cartRuleWithCoupon->coupon->code, - $cartRuleWithCoupon->cartRule->id - ); + $cartItem->calcPercentageDiscountAmounts(100.0, $cartRuleWithCoupon->coupon->code, $cartRuleWithCoupon->cartRule->id); continue; } } @@ -792,7 +885,6 @@ private function getExpectedCartItems(Example $scenario, ?cartRuleWithCoupon $ca if ($pos === null) { $cartItems[] = $cartItem; - } else { $cartItems[$pos] = $cartItem; } @@ -809,7 +901,7 @@ private function getExpectedCartItems(Example $scenario, ?cartRuleWithCoupon $ca private function calcTotals(array $cartItems): array { $result = [ - 'subTotal' => 0.0, + 'subTotal' => 0.0, 'baseSubTotal' => 0.0, ]; foreach ($cartItems as $expectedCartItem) { @@ -832,16 +924,10 @@ private function splitDiscountToItems( // split coupon amount to cart items $length = count($cartItems) - 1; for ($i = 0; $i < $length; $i++) { - $cartItems[$i]->discount_amount = round( - self::DISCOUNT_AMOUNT_CART * $cartItems[$i]->total / $totals['subTotal'], - expectedCartItem::ITEM_DISCOUNT_AMOUNT_PRECISION - ); + $cartItems[$i]->discount_amount = round(self::DISCOUNT_AMOUNT_CART * $cartItems[$i]->total / $totals['subTotal'], expectedCartItem::ITEM_DISCOUNT_AMOUNT_PRECISION); $discountAmount -= $cartItems[$i]->discount_amount; - $cartItems[$i]->base_discount_amount = round( - self::DISCOUNT_AMOUNT_CART * $cartItems[$i]->base_total / $totals['baseSubTotal'], - expectedCartItem::ITEM_DISCOUNT_AMOUNT_PRECISION - ); + $cartItems[$i]->base_discount_amount = round(self::DISCOUNT_AMOUNT_CART * $cartItems[$i]->base_total / $totals['baseSubTotal'], expectedCartItem::ITEM_DISCOUNT_AMOUNT_PRECISION); $baseDiscountAmount -= $cartItems[$i]->discount_amount; $cartItems[$i]->coupon_code = $cartRuleWithCoupon->coupon->code; @@ -858,21 +944,19 @@ private function splitDiscountToItems( } /** - * @param array $expectedCartItems + * @param array $expectedCartItems * * @return array */ private function checkMaxDiscount(array $expectedCartItems): array { foreach ($expectedCartItems as $key => $cartItem) { - $itemGrandTotal = round($cartItem->total + $cartItem->tax_amount, - expectedCartItem::ITEM_DISCOUNT_AMOUNT_PRECISION); + $itemGrandTotal = round($cartItem->total + $cartItem->tax_amount, expectedCartItem::ITEM_DISCOUNT_AMOUNT_PRECISION); if ($cartItem->discount_amount > $itemGrandTotal) { $expectedCartItems[$key]->discount_amount = $itemGrandTotal; } - $itemBaseGrandTotal = round($cartItem->base_total + $cartItem->base_tax_amount, - expectedCartItem::ITEM_DISCOUNT_AMOUNT_PRECISION); + $itemBaseGrandTotal = round($cartItem->base_total + $cartItem->base_tax_amount, expectedCartItem::ITEM_DISCOUNT_AMOUNT_PRECISION); if ($cartItem->base_discount_amount > $itemBaseGrandTotal) { $expectedCartItems[$key]->base_discount_amount = $itemBaseGrandTotal; } @@ -882,25 +966,21 @@ private function checkMaxDiscount(array $expectedCartItems): array } /** - * @param int $cartId - * @param array $expectedCartItems + * @param int $cartId + * @param array $expectedCartItems * - * @param \Tests\Unit\Category\cartRuleWithCoupon $cartRuleWithCoupon + * @param \Tests\Unit\Category\cartRuleWithCoupon $cartRuleWithCoupon * * @return \Tests\Unit\Category\expectedCart */ private function getExpectedCart(int $cartId, array $expectedCartItems, ?cartRuleWithCoupon $cartRuleWithCoupon): expectedCart { - $cart = new expectedCart( - $cartId, - auth()->guard('customer')->user()->id - ); + $cart = new expectedCart($cartId, auth() + ->guard('customer') + ->user()->id); if ($cartRuleWithCoupon) { - $cart->applyCoupon( - $cartRuleWithCoupon->cartRule->id, - $cartRuleWithCoupon->coupon->code - ); + $cart->applyCoupon($cartRuleWithCoupon->cartRule->id, $cartRuleWithCoupon->coupon->code); } foreach ($expectedCartItems as $cartItem) { @@ -922,7 +1002,7 @@ private function getExpectedCart(int $cartId, array $expectedCartItems, ?cartRul } /** - * @param \UnitTester $I + * @param \UnitTester $I * * @return array */ @@ -932,14 +1012,14 @@ private function generateTaxCategories(UnitTester $I): array $country = strtoupper(Config::get('app.default_country')) ?? 'DE'; foreach ($this->getTaxRateSpecifications() as $taxSpec => $taxRate) { $tax = $I->have(TaxRate::class, [ - 'country' => $country, + 'country' => $country, 'tax_rate' => $taxRate, ]); $taxCategorie = $I->have(TaxCategory::class); $I->have(TaxMap::class, [ - 'tax_rate_id' => $tax->id, + 'tax_rate_id' => $tax->id, 'tax_category_id' => $taxCategorie->id, ]); @@ -950,9 +1030,9 @@ private function generateTaxCategories(UnitTester $I): array } /** - * @param \UnitTester $I - * @param array $scenario - * @param array $taxCategories + * @param \UnitTester $I + * @param array $scenario + * @param array $taxCategories * * @return array * @throws \Exception @@ -971,8 +1051,8 @@ private function generateProducts(UnitTester $I, array $scenario, array $taxCate } /** - * @param \UnitTester $I - * @param array $couponConfig + * @param \UnitTester $I + * @param array $couponConfig * * @return \Tests\Unit\Category\cartRuleWithCoupon */ @@ -981,44 +1061,39 @@ private function generateCartRuleWithCoupon(UnitTester $I, array $couponConfig): $faker = Factory::create(); $couponSpecifications = $this->getCouponSpecifications(); - $ruleConfig = $this->makeRuleConfig( - $couponSpecifications[$couponConfig['scenario']], - $this->products, - $couponConfig['products'] - ); + $ruleConfig = $this->makeRuleConfig($couponSpecifications[$couponConfig['scenario']], $this->products, $couponConfig['products']); $cartRule = $I->have(CartRule::class, $ruleConfig); - DB::table('cart_rule_channels')->insert([ - 'cart_rule_id' => $cartRule->id, - 'channel_id' => core()->getCurrentChannel()->id, - ]); + DB::table('cart_rule_channels') + ->insert([ + 'cart_rule_id' => $cartRule->id, + 'channel_id' => core()->getCurrentChannel()->id, + ]); $guestCustomerGroup = $I->grabRecord('customer_groups', ['code' => 'guest']); - DB::table('cart_rule_customer_groups')->insert([ - 'cart_rule_id' => $cartRule->id, - 'customer_group_id' => $guestCustomerGroup['id'], - ]); + DB::table('cart_rule_customer_groups') + ->insert([ + 'cart_rule_id' => $cartRule->id, + 'customer_group_id' => $guestCustomerGroup['id'], + ]); $generalCustomerGroup = $I->grabRecord('customer_groups', ['code' => 'general']); - DB::table('cart_rule_customer_groups')->insert([ - 'cart_rule_id' => $cartRule->id, - 'customer_group_id' => $generalCustomerGroup['id'], - ]); + DB::table('cart_rule_customer_groups') + ->insert([ + 'cart_rule_id' => $cartRule->id, + 'customer_group_id' => $generalCustomerGroup['id'], + ]); $coupon = $I->have(CartRuleCoupon::class, [ 'cart_rule_id' => $cartRule->id, ]); - return new cartRuleWithCoupon( - $cartRule, - $coupon - ); - + return new cartRuleWithCoupon($cartRule, $coupon); } /** - * @param array $productSpec - * @param array $taxCategories + * @param array $productSpec + * @param array $taxCategories * * @return array */ @@ -1028,8 +1103,8 @@ private function makeProductConfig(array $productSpec, array $taxCategories): ar 'productInventory' => [ 'qty' => 100, ], - 'attributeValues' => [ - 'price' => 0.0, + 'attributeValues' => [ + 'price' => 0.0, 'tax_category_id' => $taxCategories[self::TAX_CATEGORY], ], ]; @@ -1052,9 +1127,9 @@ private function makeProductConfig(array $productSpec, array $taxCategories): ar } /** - * @param array $ruleSpec - * @param array $products - * @param array $couponableProducts + * @param array $ruleSpec + * @param array $products + * @param array $couponableProducts * * @return array */ @@ -1062,17 +1137,17 @@ private function makeRuleConfig(array $ruleSpec, array $products, array $coupona { foreach ($couponableProducts as $item) { $conditions[] = [ - 'value' => $products[$item]->sku, - 'operator' => '==', - 'attribute' => 'product|sku', + 'value' => $products[$item]->sku, + 'operator' => '==', + 'attribute' => 'product|sku', 'attribute_type' => 'text', ]; } $result = [ - 'action_type' => $ruleSpec['actionType'], + 'action_type' => $ruleSpec['actionType'], 'discount_amount' => $ruleSpec['discountAmount'], - 'conditions' => $conditions ?? null, + 'conditions' => $conditions ?? null, ]; return $result; @@ -1086,21 +1161,21 @@ private function getProductSpecifications(): array return [ [ 'productScenario' => self::PRODUCT_FREE, - 'productType' => Laravel5Helper::SIMPLE_PRODUCT, - 'freeOfCharge' => true, - 'reducedTax' => false, + 'productType' => Laravel5Helper::SIMPLE_PRODUCT, + 'freeOfCharge' => true, + 'reducedTax' => false, ], [ 'productScenario' => self::PRODUCT_NOT_FREE, - 'productType' => Laravel5Helper::SIMPLE_PRODUCT, - 'freeOfCharge' => false, - 'reducedTax' => false, + 'productType' => Laravel5Helper::SIMPLE_PRODUCT, + 'freeOfCharge' => false, + 'reducedTax' => false, ], [ 'productScenario' => self::PRODUCT_NOT_FREE_REDUCED_TAX, - 'productType' => Laravel5Helper::SIMPLE_PRODUCT, - 'freeOfCharge' => false, - 'reducedTax' => true, + 'productType' => Laravel5Helper::SIMPLE_PRODUCT, + 'freeOfCharge' => false, + 'reducedTax' => true, ], ]; } @@ -1113,27 +1188,27 @@ private function getCouponSpecifications(): array return [ [ 'couponScenario' => self::COUPON_FIXED, - 'actionType' => self::ACTION_TYPE_FIXED, + 'actionType' => self::ACTION_TYPE_FIXED, 'discountAmount' => self::DISCOUNT_AMOUNT_FIX, ], [ 'couponScenario' => self::COUPON_FIXED_FULL, - 'actionType' => self::ACTION_TYPE_FIXED, + 'actionType' => self::ACTION_TYPE_FIXED, 'discountAmount' => self::DISCOUNT_AMOUNT_FIX_FULL, ], [ 'couponScenario' => self::COUPON_PERCENTAGE, - 'actionType' => self::ACTION_TYPE_PERCENTAGE, + 'actionType' => self::ACTION_TYPE_PERCENTAGE, 'discountAmount' => self::DISCOUNT_AMOUNT_PERCENT, ], [ 'couponScenario' => self::COUPON_PERCENTAGE_FULL, - 'actionType' => self::ACTION_TYPE_PERCENTAGE, + 'actionType' => self::ACTION_TYPE_PERCENTAGE, 'discountAmount' => 100.0, ], [ 'couponScenario' => self::COUPON_FIXED_CART, - 'actionType' => self::ACTION_TYPE_CART_FIXED, + 'actionType' => self::ACTION_TYPE_CART_FIXED, 'discountAmount' => self::DISCOUNT_AMOUNT_CART, ], ]; @@ -1145,15 +1220,15 @@ private function getCouponSpecifications(): array private function getTaxRateSpecifications(): array { return [ - self::TAX_CATEGORY => self::TAX_RATE, + self::TAX_CATEGORY => self::TAX_RATE, self::TAX_REDUCED_CATEGORY => self::REDUCED_TAX_RATE, ]; } /** - * @param string $param + * @param string $param * @param $needleValue - * @param array $data + * @param array $data * * @return int|null */ @@ -1167,6 +1242,4 @@ private function array_find(string $param, $needleValue, array $data): ?int return null; } - - } \ No newline at end of file