From 2843023a47151da52da65ef4d95c9c3270b43b03 Mon Sep 17 00:00:00 2001 From: Khalyomede Date: Fri, 3 Nov 2023 16:58:43 +0100 Subject: [PATCH] #55 add ability to specify multiple columns to translate on a single model (#56) * #55 add ability to specify multiple columns to translate on a single model * #55 add dependencies updates --- CHANGELOG.md | 8 + README.md | 17 + composer.json | 14 +- composer.lock | 452 +++++++++--------- src/Commands/Translate.php | 27 +- tests/Feature/Commands/TranslateTest.php | 38 +- ...3_03_08_211000_create_book_types_table.php | 1 + .../misc/database/seeders/BookTypeSeeder.php | 3 + 8 files changed, 320 insertions(+), 240 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd6513a..dcf47bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Ability to specify multiple columns to translate for a single model ([#55](https://github.com/khalyomede/laravel-translate/issues/55)). + +### Breaking + +- The order of the translations is not the same when translating a single model column ([#55](https://github.com/khalyomede/laravel-translate/issues/55)). + ## [0.1.2] - 2023-09-19 ### Fixed diff --git a/README.md b/README.md index 73efe57..4638001 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,23 @@ return [ ]; ``` +If you have multiple columns for the same model, you can also pass an array: + +```php +use App\Models\Post; + +return [ + // ... + "models" => [ + Post::class => [ + "title", + "description", + ], + ], + // ... +]; +``` + You pass it the name of the model as key, and the name of the column to pull translation from as the value. This assumes you translate your model like this for example: diff --git a/composer.json b/composer.json index 6ea51b0..922abb3 100644 --- a/composer.json +++ b/composer.json @@ -28,13 +28,13 @@ "stillat/blade-parser": "1.*" }, "require-dev": { - "orchestra/testbench": "8.12.1", - "nunomaduro/collision": "7.9.0", - "rector/rector": "0.18.4", - "driftingly/rector-laravel": "0.26.1", - "phpstan/phpstan": "1.10.37", + "orchestra/testbench": "8.14.0", + "nunomaduro/collision": "7.10.0", + "rector/rector": "0.18.6", + "driftingly/rector-laravel": "0.26.2", + "phpstan/phpstan": "1.10.40", "nunomaduro/larastan": "2.6.4", - "friendsofphp/php-cs-fixer": "3.34.0" + "friendsofphp/php-cs-fixer": "3.37.1" }, "scripts": { "test": "testbench package:test", @@ -61,4 +61,4 @@ ] } } -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index 9321208..f47f10c 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": "313cc271d8bad04bcd996339015f5018", + "content-hash": "5190e5341b530cc764d05fb1a8495624", "packages": [ { "name": "brick/math", @@ -367,16 +367,16 @@ }, { "name": "egulias/email-validator", - "version": "4.0.1", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff" + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/3a85486b709bc384dae8eb78fb2eec649bdb64ff", - "reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ebaaf5be6c0286928352e054f2d5125608e5405e", + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e", "shasum": "" }, "require": { @@ -385,8 +385,8 @@ "symfony/polyfill-intl-idn": "^1.26" }, "require-dev": { - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^4.30" + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" @@ -422,7 +422,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/4.0.1" + "source": "https://github.com/egulias/EmailValidator/tree/4.0.2" }, "funding": [ { @@ -430,25 +430,25 @@ "type": "github" } ], - "time": "2023-01-14T14:17:03+00:00" + "time": "2023-10-06T06:47:41+00:00" }, { "name": "fruitcake/php-cors", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/fruitcake/php-cors.git", - "reference": "58571acbaa5f9f462c9c77e911700ac66f446d4e" + "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/58571acbaa5f9f462c9c77e911700ac66f446d4e", - "reference": "58571acbaa5f9f462c9c77e911700ac66f446d4e", + "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/3d158f36e7875e2f040f37bc0573956240a5a38b", + "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b", "shasum": "" }, "require": { "php": "^7.4|^8.0", - "symfony/http-foundation": "^4.4|^5.4|^6" + "symfony/http-foundation": "^4.4|^5.4|^6|^7" }, "require-dev": { "phpstan/phpstan": "^1.4", @@ -458,7 +458,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.1-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -489,7 +489,7 @@ ], "support": { "issues": "https://github.com/fruitcake/php-cors/issues", - "source": "https://github.com/fruitcake/php-cors/tree/v1.2.0" + "source": "https://github.com/fruitcake/php-cors/tree/v1.3.0" }, "funding": [ { @@ -501,7 +501,7 @@ "type": "github" } ], - "time": "2022-02-20T15:07:15+00:00" + "time": "2023-10-12T05:21:21+00:00" }, { "name": "graham-campbell/result-type", @@ -647,16 +647,16 @@ }, { "name": "laravel/framework", - "version": "v10.25.2", + "version": "v10.30.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "6014dd456b414b305fb0b408404efdcec18e64bc" + "reference": "7a2da50258c4d0f693b738d3f3c69b2693aea6c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/6014dd456b414b305fb0b408404efdcec18e64bc", - "reference": "6014dd456b414b305fb0b408404efdcec18e64bc", + "url": "https://api.github.com/repos/laravel/framework/zipball/7a2da50258c4d0f693b738d3f3c69b2693aea6c1", + "reference": "7a2da50258c4d0f693b738d3f3c69b2693aea6c1", "shasum": "" }, "require": { @@ -689,7 +689,7 @@ "symfony/console": "^6.2", "symfony/error-handler": "^6.2", "symfony/finder": "^6.2", - "symfony/http-foundation": "^6.2", + "symfony/http-foundation": "^6.3", "symfony/http-kernel": "^6.2", "symfony/mailer": "^6.2", "symfony/mime": "^6.2", @@ -756,13 +756,15 @@ "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.5.1", + "nyholm/psr7": "^1.2", "orchestra/testbench-core": "^8.12", "pda/pheanstalk": "^4.0", "phpstan/phpstan": "^1.4.7", "phpunit/phpunit": "^10.0.7", "predis/predis": "^2.0.2", "symfony/cache": "^6.2", - "symfony/http-client": "^6.2.4" + "symfony/http-client": "^6.2.4", + "symfony/psr-http-message-bridge": "^2.0" }, "suggest": { "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", @@ -843,27 +845,27 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-09-28T14:08:59+00:00" + "time": "2023-11-01T13:52:17+00:00" }, { "name": "laravel/prompts", - "version": "v0.1.10", + "version": "v0.1.13", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "37ed55f6950d921a87d5beeab16d03f8de26b060" + "reference": "e1379d8ead15edd6cc4369c22274345982edc95a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/37ed55f6950d921a87d5beeab16d03f8de26b060", - "reference": "37ed55f6950d921a87d5beeab16d03f8de26b060", + "url": "https://api.github.com/repos/laravel/prompts/zipball/e1379d8ead15edd6cc4369c22274345982edc95a", + "reference": "e1379d8ead15edd6cc4369c22274345982edc95a", "shasum": "" }, "require": { "ext-mbstring": "*", "illuminate/collections": "^10.0|^11.0", "php": "^8.1", - "symfony/console": "^6.2" + "symfony/console": "^6.2|^7.0" }, "conflict": { "illuminate/console": ">=10.17.0 <10.25.0", @@ -898,22 +900,22 @@ ], "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.1.10" + "source": "https://github.com/laravel/prompts/tree/v0.1.13" }, - "time": "2023-09-29T07:26:07+00:00" + "time": "2023-10-27T13:53:59+00:00" }, { "name": "laravel/serializable-closure", - "version": "v1.3.1", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "e5a3057a5591e1cfe8183034b0203921abe2c902" + "reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/e5a3057a5591e1cfe8183034b0203921abe2c902", - "reference": "e5a3057a5591e1cfe8183034b0203921abe2c902", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/076fe2cf128bd54b4341cdc6d49b95b34e101e4c", + "reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c", "shasum": "" }, "require": { @@ -960,7 +962,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2023-07-14T13:56:28+00:00" + "time": "2023-10-17T13:38:16+00:00" }, { "name": "league/commonmark", @@ -1152,16 +1154,16 @@ }, { "name": "league/flysystem", - "version": "3.16.0", + "version": "3.18.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "4fdf372ca6b63c6e281b1c01a624349ccb757729" + "reference": "015633a05aee22490495159237a5944091d8281e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4fdf372ca6b63c6e281b1c01a624349ccb757729", - "reference": "4fdf372ca6b63c6e281b1c01a624349ccb757729", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/015633a05aee22490495159237a5944091d8281e", + "reference": "015633a05aee22490495159237a5944091d8281e", "shasum": "" }, "require": { @@ -1179,8 +1181,8 @@ "symfony/http-client": "<5.2" }, "require-dev": { - "async-aws/s3": "^1.5", - "async-aws/simple-s3": "^1.1", + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", "aws/aws-sdk-php": "^3.220.0", "composer/semver": "^3.0", "ext-fileinfo": "*", @@ -1190,7 +1192,7 @@ "google/cloud-storage": "^1.23", "microsoft/azure-storage-blob": "^1.1", "phpseclib/phpseclib": "^3.0.14", - "phpstan/phpstan": "^0.12.26", + "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.5.11|^10.0", "sabre/dav": "^4.3.1" }, @@ -1226,7 +1228,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.16.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.18.0" }, "funding": [ { @@ -1238,20 +1240,20 @@ "type": "github" } ], - "time": "2023-09-07T19:22:17+00:00" + "time": "2023-10-20T17:59:40+00:00" }, { "name": "league/flysystem-local", - "version": "3.16.0", + "version": "3.18.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "ec7383f25642e6fd4bb0c9554fc2311245391781" + "reference": "e7381ef7643f658b87efb7dbe98fe538fb1bbf32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/ec7383f25642e6fd4bb0c9554fc2311245391781", - "reference": "ec7383f25642e6fd4bb0c9554fc2311245391781", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/e7381ef7643f658b87efb7dbe98fe538fb1bbf32", + "reference": "e7381ef7643f658b87efb7dbe98fe538fb1bbf32", "shasum": "" }, "require": { @@ -1286,7 +1288,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem-local/issues", - "source": "https://github.com/thephpleague/flysystem-local/tree/3.16.0" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.18.0" }, "funding": [ { @@ -1298,20 +1300,20 @@ "type": "github" } ], - "time": "2023-08-30T10:23:59+00:00" + "time": "2023-10-19T20:07:13+00:00" }, { "name": "league/mime-type-detection", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96" + "reference": "b6a5854368533df0295c5761a0253656a2e52d9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/a6dfb1194a2946fcdc1f38219445234f65b35c96", - "reference": "a6dfb1194a2946fcdc1f38219445234f65b35c96", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b6a5854368533df0295c5761a0253656a2e52d9e", + "reference": "b6a5854368533df0295c5761a0253656a2e52d9e", "shasum": "" }, "require": { @@ -1342,7 +1344,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.13.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.14.0" }, "funding": [ { @@ -1354,20 +1356,20 @@ "type": "tidelift" } ], - "time": "2023-08-05T12:09:49+00:00" + "time": "2023-10-17T14:13:20+00:00" }, { "name": "monolog/monolog", - "version": "3.4.0", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "e2392369686d420ca32df3803de28b5d6f76867d" + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/e2392369686d420ca32df3803de28b5d6f76867d", - "reference": "e2392369686d420ca32df3803de28b5d6f76867d", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c915e2634718dbc8a4a15c61b0e62e7a44e14448", + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448", "shasum": "" }, "require": { @@ -1443,7 +1445,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.4.0" + "source": "https://github.com/Seldaek/monolog/tree/3.5.0" }, "funding": [ { @@ -1455,7 +1457,7 @@ "type": "tidelift" } ], - "time": "2023-06-21T08:46:11+00:00" + "time": "2023-10-27T15:32:31+00:00" }, { "name": "nesbot/carbon", @@ -1565,16 +1567,16 @@ }, { "name": "nette/schema", - "version": "v1.2.4", + "version": "v1.2.5", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab" + "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/c9ff517a53903b3d4e29ec547fb20feecb05b8ab", - "reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab", + "url": "https://api.github.com/repos/nette/schema/zipball/0462f0166e823aad657c9224d0f849ecac1ba10a", + "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a", "shasum": "" }, "require": { @@ -1621,22 +1623,22 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.4" + "source": "https://github.com/nette/schema/tree/v1.2.5" }, - "time": "2023-08-05T18:56:25+00:00" + "time": "2023-10-05T20:37:59+00:00" }, { "name": "nette/utils", - "version": "v4.0.2", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "cead6637226456b35e1175cc53797dd585d85545" + "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/cead6637226456b35e1175cc53797dd585d85545", - "reference": "cead6637226456b35e1175cc53797dd585d85545", + "url": "https://api.github.com/repos/nette/utils/zipball/a9d127dd6a203ce6d255b2e2db49759f7506e015", + "reference": "a9d127dd6a203ce6d255b2e2db49759f7506e015", "shasum": "" }, "require": { @@ -1707,9 +1709,9 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.2" + "source": "https://github.com/nette/utils/tree/v4.0.3" }, - "time": "2023-09-19T11:58:07+00:00" + "time": "2023-10-29T21:02:13+00:00" }, { "name": "nunomaduro/termwind", @@ -2873,16 +2875,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "b50f5e281d722cb0f4c296f908bacc3e2b721957" + "reference": "59d1837d5d992d16c2628cd0d6b76acf8d69b33e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b50f5e281d722cb0f4c296f908bacc3e2b721957", - "reference": "b50f5e281d722cb0f4c296f908bacc3e2b721957", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/59d1837d5d992d16c2628cd0d6b76acf8d69b33e", + "reference": "59d1837d5d992d16c2628cd0d6b76acf8d69b33e", "shasum": "" }, "require": { @@ -2892,12 +2894,12 @@ "symfony/polyfill-php83": "^1.27" }, "conflict": { - "symfony/cache": "<6.2" + "symfony/cache": "<6.3" }, "require-dev": { - "doctrine/dbal": "^2.13.1|^3.0", + "doctrine/dbal": "^2.13.1|^3|^4", "predis/predis": "^1.1|^2.0", - "symfony/cache": "^5.4|^6.0", + "symfony/cache": "^6.3", "symfony/dependency-injection": "^5.4|^6.0", "symfony/expression-language": "^5.4|^6.0", "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", @@ -2930,7 +2932,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.3.5" + "source": "https://github.com/symfony/http-foundation/tree/v6.3.7" }, "funding": [ { @@ -2946,20 +2948,20 @@ "type": "tidelift" } ], - "time": "2023-09-04T21:33:54+00:00" + "time": "2023-10-28T23:55:27+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.3.5", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "9f991a964368bee8d883e8d57ced4fe9fff04dfc" + "reference": "6d4098095f93279d9536a0e9124439560cc764d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9f991a964368bee8d883e8d57ced4fe9fff04dfc", - "reference": "9f991a964368bee8d883e8d57ced4fe9fff04dfc", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6d4098095f93279d9536a0e9124439560cc764d0", + "reference": "6d4098095f93279d9536a0e9124439560cc764d0", "shasum": "" }, "require": { @@ -3043,7 +3045,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.3.5" + "source": "https://github.com/symfony/http-kernel/tree/v6.3.7" }, "funding": [ { @@ -3059,7 +3061,7 @@ "type": "tidelift" } ], - "time": "2023-09-30T06:37:04+00:00" + "time": "2023-10-29T14:31:45+00:00" }, { "name": "symfony/mailer", @@ -4277,16 +4279,16 @@ }, { "name": "symfony/translation", - "version": "v6.3.3", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd" + "reference": "30212e7c87dcb79c83f6362b00bde0e0b1213499" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", - "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", + "url": "https://api.github.com/repos/symfony/translation/zipball/30212e7c87dcb79c83f6362b00bde0e0b1213499", + "reference": "30212e7c87dcb79c83f6362b00bde0e0b1213499", "shasum": "" }, "require": { @@ -4352,7 +4354,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.3.3" + "source": "https://github.com/symfony/translation/tree/v6.3.7" }, "funding": [ { @@ -4368,7 +4370,7 @@ "type": "tidelift" } ], - "time": "2023-07-31T07:08:24+00:00" + "time": "2023-10-28T23:11:45+00:00" }, { "name": "symfony/translation-contracts", @@ -4524,16 +4526,16 @@ }, { "name": "symfony/var-dumper", - "version": "v6.3.5", + "version": "v6.3.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3d9999376be5fea8de47752837a3e1d1c5f69ef5" + "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3d9999376be5fea8de47752837a3e1d1c5f69ef5", - "reference": "3d9999376be5fea8de47752837a3e1d1c5f69ef5", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/999ede244507c32b8e43aebaa10e9fce20de7c97", + "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97", "shasum": "" }, "require": { @@ -4588,7 +4590,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.5" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.6" }, "funding": [ { @@ -4604,7 +4606,7 @@ "type": "tidelift" } ], - "time": "2023-09-12T10:11:35+00:00" + "time": "2023-10-12T18:45:56+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -5097,16 +5099,16 @@ }, { "name": "driftingly/rector-laravel", - "version": "0.26.1", + "version": "0.26.2", "source": { "type": "git", "url": "https://github.com/driftingly/rector-laravel.git", - "reference": "ae46f25d425351f997d7d09cd63968581319b7fc" + "reference": "cf6d0a7c8e2dc33b6e2bb8ccb4638f44a5c09671" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/ae46f25d425351f997d7d09cd63968581319b7fc", - "reference": "ae46f25d425351f997d7d09cd63968581319b7fc", + "url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/cf6d0a7c8e2dc33b6e2bb8ccb4638f44a5c09671", + "reference": "cf6d0a7c8e2dc33b6e2bb8ccb4638f44a5c09671", "shasum": "" }, "require": { @@ -5125,9 +5127,9 @@ "description": "Rector upgrades rules for Laravel Framework", "support": { "issues": "https://github.com/driftingly/rector-laravel/issues", - "source": "https://github.com/driftingly/rector-laravel/tree/0.26.1" + "source": "https://github.com/driftingly/rector-laravel/tree/0.26.2" }, - "time": "2023-09-30T18:27:39+00:00" + "time": "2023-10-11T21:42:53+00:00" }, { "name": "fakerphp/faker", @@ -5270,16 +5272,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.34.0", + "version": "v3.37.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "7c7a4ad2ed8fe50df3e25528218b13d383608f23" + "reference": "c3fe76976081ab871aa654e872da588077e19679" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7c7a4ad2ed8fe50df3e25528218b13d383608f23", - "reference": "7c7a4ad2ed8fe50df3e25528218b13d383608f23", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/c3fe76976081ab871aa654e872da588077e19679", + "reference": "c3fe76976081ab871aa654e872da588077e19679", "shasum": "" }, "require": { @@ -5300,9 +5302,6 @@ "symfony/process": "^5.4 || ^6.0", "symfony/stopwatch": "^5.4 || ^6.0" }, - "conflict": { - "stevebauman/unfinalize": "*" - }, "require-dev": { "facile-it/paraunit": "^1.3 || ^2.0", "justinrainbow/json-schema": "^5.2", @@ -5315,8 +5314,6 @@ "phpspec/prophecy": "^1.16", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", "symfony/phpunit-bridge": "^6.2.3", "symfony/yaml": "^5.4 || ^6.0" }, @@ -5356,7 +5353,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.34.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.37.1" }, "funding": [ { @@ -5364,7 +5361,7 @@ "type": "github" } ], - "time": "2023-09-29T15:34:26+00:00" + "time": "2023-10-29T20:51:23+00:00" }, { "name": "guzzlehttp/psr7", @@ -5804,16 +5801,16 @@ }, { "name": "nunomaduro/collision", - "version": "v7.9.0", + "version": "v7.10.0", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "296d0cf9fe462837ac0da8a568b56fc026b132da" + "reference": "49ec67fa7b002712da8526678abd651c09f375b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/296d0cf9fe462837ac0da8a568b56fc026b132da", - "reference": "296d0cf9fe462837ac0da8a568b56fc026b132da", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/49ec67fa7b002712da8526678abd651c09f375b2", + "reference": "49ec67fa7b002712da8526678abd651c09f375b2", "shasum": "" }, "require": { @@ -5822,19 +5819,22 @@ "php": "^8.1.0", "symfony/console": "^6.3.4" }, + "conflict": { + "laravel/framework": ">=11.0.0" + }, "require-dev": { - "brianium/paratest": "^7.2.7", - "laravel/framework": "^10.23.1", - "laravel/pint": "^1.13.1", + "brianium/paratest": "^7.3.0", + "laravel/framework": "^10.28.0", + "laravel/pint": "^1.13.3", "laravel/sail": "^1.25.0", "laravel/sanctum": "^3.3.1", "laravel/tinker": "^2.8.2", "nunomaduro/larastan": "^2.6.4", - "orchestra/testbench-core": "^8.11.0", - "pestphp/pest": "^2.19.1", - "phpunit/phpunit": "^10.3.5", + "orchestra/testbench-core": "^8.13.0", + "pestphp/pest": "^2.23.2", + "phpunit/phpunit": "^10.4.1", "sebastian/environment": "^6.0.1", - "spatie/laravel-ignition": "^2.3.0" + "spatie/laravel-ignition": "^2.3.1" }, "type": "library", "extra": { @@ -5893,7 +5893,7 @@ "type": "patreon" } ], - "time": "2023-09-19T10:45:09+00:00" + "time": "2023-10-11T15:45:01+00:00" }, { "name": "nunomaduro/larastan", @@ -5993,30 +5993,31 @@ }, { "name": "orchestra/canvas", - "version": "v8.10.1", + "version": "v8.11.2", "source": { "type": "git", "url": "https://github.com/orchestral/canvas.git", - "reference": "eef3eb34e263cc462c0eb284ba002f2829b04e2a" + "reference": "5038b630e2306a8e7486d69628d84fa2d1764cb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/canvas/zipball/eef3eb34e263cc462c0eb284ba002f2829b04e2a", - "reference": "eef3eb34e263cc462c0eb284ba002f2829b04e2a", + "url": "https://api.github.com/repos/orchestral/canvas/zipball/5038b630e2306a8e7486d69628d84fa2d1764cb1", + "reference": "5038b630e2306a8e7486d69628d84fa2d1764cb1", "shasum": "" }, "require": { "composer-runtime-api": "^2.2", "composer/semver": "^3.0", - "illuminate/database": "^10.23", - "illuminate/support": "^10.23", - "orchestra/canvas-core": "^8.8", + "illuminate/console": "^10.26", + "illuminate/database": "^10.26", + "illuminate/support": "^10.26", + "orchestra/canvas-core": "^8.9", "orchestra/testbench-core": "^8.11", "php": "^8.1", "symfony/yaml": "^6.2" }, "require-dev": { - "laravel/framework": "^10.23", + "laravel/framework": "^10.26", "laravel/pint": "^1.6", "mockery/mockery": "^1.5.1", "phpstan/phpstan": "^1.10.5", @@ -6059,45 +6060,40 @@ "description": "Code Generators for Laravel Applications and Packages", "support": { "issues": "https://github.com/orchestral/canvas/issues", - "source": "https://github.com/orchestral/canvas/tree/v8.10.1" + "source": "https://github.com/orchestral/canvas/tree/v8.11.2" }, - "time": "2023-09-25T08:37:12+00:00" + "time": "2023-10-26T21:59:54+00:00" }, { "name": "orchestra/canvas-core", - "version": "v8.8.0", + "version": "v8.10.0", "source": { "type": "git", "url": "https://github.com/orchestral/canvas-core.git", - "reference": "d44ffd6895685a6535949c7cce2650a67dd7d364" + "reference": "642a966b1f8a351a994c04ce1e03a5ddd1025ff5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/canvas-core/zipball/d44ffd6895685a6535949c7cce2650a67dd7d364", - "reference": "d44ffd6895685a6535949c7cce2650a67dd7d364", + "url": "https://api.github.com/repos/orchestral/canvas-core/zipball/642a966b1f8a351a994c04ce1e03a5ddd1025ff5", + "reference": "642a966b1f8a351a994c04ce1e03a5ddd1025ff5", "shasum": "" }, "require": { "composer-runtime-api": "^2.2", "composer/semver": "^3.0", - "illuminate/console": "^10.17", - "illuminate/filesystem": "^10.17", + "illuminate/console": "^10.26", + "illuminate/filesystem": "^10.26", "php": "^8.1" }, "conflict": { - "orchestra/canvas": "<8.9.0", + "orchestra/canvas": "<8.11.0", "orchestra/testbench-core": "<8.2.0" }, "require-dev": { - "fakerphp/faker": "^1.21", - "laravel/framework": "^10.17", "laravel/pint": "^1.6", - "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^8.11", - "orchestra/workbench": "^0.3", + "orchestra/testbench": "^8.13", "phpstan/phpstan": "^1.10.6", - "phpunit/phpunit": "^10.1", - "symfony/yaml": "^6.2" + "phpunit/phpunit": "^10.1" }, "type": "library", "extra": { @@ -6132,31 +6128,31 @@ "description": "Code Generators Builder for Laravel Applications and Packages", "support": { "issues": "https://github.com/orchestral/canvas/issues", - "source": "https://github.com/orchestral/canvas-core/tree/v8.8.0" + "source": "https://github.com/orchestral/canvas-core/tree/v8.10.0" }, - "time": "2023-09-19T04:26:25+00:00" + "time": "2023-10-16T01:44:47+00:00" }, { "name": "orchestra/testbench", - "version": "v8.12.1", + "version": "v8.14.0", "source": { "type": "git", "url": "https://github.com/orchestral/testbench.git", - "reference": "9bae3c28789295db875eee0d3395c4ba23f1e5ae" + "reference": "7dacad632a5f48830443f739cd846212c174448a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/9bae3c28789295db875eee0d3395c4ba23f1e5ae", - "reference": "9bae3c28789295db875eee0d3395c4ba23f1e5ae", + "url": "https://api.github.com/repos/orchestral/testbench/zipball/7dacad632a5f48830443f739cd846212c174448a", + "reference": "7dacad632a5f48830443f739cd846212c174448a", "shasum": "" }, "require": { "composer-runtime-api": "^2.2", "fakerphp/faker": "^1.21", - "laravel/framework": ">=10.23.1 <10.26.0", + "laravel/framework": "^10.23.1", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": ">=8.12.0 <8.13.0", - "orchestra/workbench": "^0.4.0", + "orchestra/testbench-core": ">=8.14.0 <8.15.0", + "orchestra/workbench": "^1.0", "php": "^8.1", "phpunit/phpunit": "^9.6 || ^10.1", "spatie/laravel-ray": "^1.32.4", @@ -6188,28 +6184,35 @@ ], "support": { "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench/tree/v8.12.1" + "source": "https://github.com/orchestral/testbench/tree/v8.14.0" }, - "time": "2023-09-25T14:33:44+00:00" + "time": "2023-10-24T04:44:26+00:00" }, { "name": "orchestra/testbench-core", - "version": "v8.12.1", + "version": "v8.14.4", "source": { "type": "git", "url": "https://github.com/orchestral/testbench-core.git", - "reference": "9a7b63f9cd10dd15cf7c9d4aad2ccaa688465a1f" + "reference": "2501be03ccd199851006b3d286b303b97fc55738" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/9a7b63f9cd10dd15cf7c9d4aad2ccaa688465a1f", - "reference": "9a7b63f9cd10dd15cf7c9d4aad2ccaa688465a1f", + "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/2501be03ccd199851006b3d286b303b97fc55738", + "reference": "2501be03ccd199851006b3d286b303b97fc55738", "shasum": "" }, "require": { "composer-runtime-api": "^2.2", "php": "^8.1" }, + "conflict": { + "brianium/paratest": "<6.4.0 || >=7.0.0 <7.1.4 || >=8.0.0", + "laravel/framework": "<10.23.1 || >=11.0.0", + "nunomaduro/collision": "<6.4.0 || >=7.0.0 <7.4.0 || >=8.0.0", + "orchestra/workbench": "<1.0.0", + "phpunit/phpunit": "<9.6.0 || >=10.5.0" + }, "require-dev": { "fakerphp/faker": "^1.21", "laravel/framework": "^10.23", @@ -6223,7 +6226,7 @@ "vlucas/phpdotenv": "^5.4.1" }, "suggest": { - "brianium/paratest": "Allow using parallel tresting (^6.4 || ^7.1.4).", + "brianium/paratest": "Allow using parallel testing (^6.4 || ^7.1.4).", "fakerphp/faker": "Allow using Faker for testing (^1.21).", "laravel/framework": "Required for testing (^10.23).", "mockery/mockery": "Allow using Mockery for testing (^1.5.1).", @@ -6271,45 +6274,44 @@ "issues": "https://github.com/orchestral/testbench/issues", "source": "https://github.com/orchestral/testbench-core" }, - "time": "2023-09-26T12:50:24+00:00" + "time": "2023-11-02T13:53:10+00:00" }, { "name": "orchestra/workbench", - "version": "v0.4.1", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/orchestral/workbench.git", - "reference": "21acf1015ac48e36cb468bffd161115689958782" + "reference": "0b1a0632d6a849831410c00c5a96e77bd43ddc78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/workbench/zipball/21acf1015ac48e36cb468bffd161115689958782", - "reference": "21acf1015ac48e36cb468bffd161115689958782", + "url": "https://api.github.com/repos/orchestral/workbench/zipball/0b1a0632d6a849831410c00c5a96e77bd43ddc78", + "reference": "0b1a0632d6a849831410c00c5a96e77bd43ddc78", "shasum": "" }, "require": { "composer-runtime-api": "^2.2", - "illuminate/console": "^9.52.15 || ^10.23.0", - "illuminate/support": "^9.52.15 || ^10.23.0", + "fakerphp/faker": "^1.21", + "laravel/framework": "^9.52.15 || ^10.26.0", "laravel/tinker": "^2.8.2", - "orchestra/canvas": "^7.10.0 || ^8.9.0", - "orchestra/testbench-core": "^7.32.0 || ^8.12.0", - "php": "^8.0" + "orchestra/canvas": "^7.10.0 || ^8.11.0", + "orchestra/testbench-core": "^7.34.0 || ^8.14.0", + "php": "^8.0", + "symfony/yaml": "^6.0.9" }, "require-dev": { - "fakerphp/faker": "^1.21", - "laravel/framework": "^9.52.15 || ^10.23.0", "laravel/pint": "^1.4", "mockery/mockery": "^1.5.1", "phpstan/phpstan": "^1.10.7", "phpunit/phpunit": "^9.6", "spatie/laravel-ray": "^1.32.4", - "symfony/yaml": "^6.0.9" + "symfony/process": "^6.0.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.4.x-dev" + "dev-master": "0.5.x-dev" } }, "autoload": { @@ -6336,9 +6338,9 @@ ], "support": { "issues": "https://github.com/orchestral/workbench/issues", - "source": "https://github.com/orchestral/workbench/tree/v0.4.1" + "source": "https://github.com/orchestral/workbench/tree/v1.0.1" }, - "time": "2023-09-26T13:04:34+00:00" + "time": "2023-10-31T01:06:37+00:00" }, { "name": "phar-io/manifest", @@ -6540,16 +6542,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.37", + "version": "1.10.40", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e" + "reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/058ba07e92f744d4dcf6061ae75283d0c6456f2e", - "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/93c84b5bf7669920d823631e39904d69b9c7dc5d", + "reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d", "shasum": "" }, "require": { @@ -6598,20 +6600,20 @@ "type": "tidelift" } ], - "time": "2023-10-02T16:18:37+00:00" + "time": "2023-10-30T14:48:31+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "10.1.6", + "version": "10.1.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "56f33548fe522c8d82da7ff3824b42829d324364" + "reference": "355324ca4980b8916c18b9db29f3ef484078f26e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/56f33548fe522c8d82da7ff3824b42829d324364", - "reference": "56f33548fe522c8d82da7ff3824b42829d324364", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/355324ca4980b8916c18b9db29f3ef484078f26e", + "reference": "355324ca4980b8916c18b9db29f3ef484078f26e", "shasum": "" }, "require": { @@ -6668,7 +6670,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.6" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.7" }, "funding": [ { @@ -6676,7 +6678,7 @@ "type": "github" } ], - "time": "2023-09-19T04:59:03+00:00" + "time": "2023-10-04T15:34:17+00:00" }, { "name": "phpunit/php-file-iterator", @@ -6923,16 +6925,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.3.5", + "version": "10.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "747c3b2038f1139e3dcd9886a3f5a948648b7503" + "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/747c3b2038f1139e3dcd9886a3f5a948648b7503", - "reference": "747c3b2038f1139e3dcd9886a3f5a948648b7503", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", + "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", "shasum": "" }, "require": { @@ -6972,7 +6974,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.3-dev" + "dev-main": "10.4-dev" } }, "autoload": { @@ -7004,7 +7006,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.3.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.2" }, "funding": [ { @@ -7020,7 +7022,7 @@ "type": "tidelift" } ], - "time": "2023-09-19T05:42:37+00:00" + "time": "2023-10-26T07:21:45+00:00" }, { "name": "pimple/pimple", @@ -7185,16 +7187,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.21", + "version": "v0.11.22", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "bcb22101107f3bf770523b65630c9d547f60c540" + "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/bcb22101107f3bf770523b65630c9d547f60c540", - "reference": "bcb22101107f3bf770523b65630c9d547f60c540", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/128fa1b608be651999ed9789c95e6e2a31b5802b", + "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b", "shasum": "" }, "require": { @@ -7223,7 +7225,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "0.11.x-dev" + "dev-0.11": "0.11.x-dev" }, "bamarni-bin": { "bin-links": false, @@ -7259,9 +7261,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.21" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.22" }, - "time": "2023-09-17T21:15:54+00:00" + "time": "2023-10-14T21:56:36+00:00" }, { "name": "ralouphie/getallheaders", @@ -7309,21 +7311,21 @@ }, { "name": "rector/rector", - "version": "0.18.4", + "version": "0.18.6", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "d99a91176b7eb7f2b6d509a6486b3661c6dfd370" + "reference": "02041b220704b9cbe075f0310d0954b2fda5c40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/d99a91176b7eb7f2b6d509a6486b3661c6dfd370", - "reference": "d99a91176b7eb7f2b6d509a6486b3661c6dfd370", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/02041b220704b9cbe075f0310d0954b2fda5c40c", + "reference": "02041b220704b9cbe075f0310d0954b2fda5c40c", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.31" + "phpstan/phpstan": "^1.10.35" }, "conflict": { "rector/rector-doctrine": "*", @@ -7353,7 +7355,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.18.4" + "source": "https://github.com/rectorphp/rector/tree/0.18.6" }, "funding": [ { @@ -7361,7 +7363,7 @@ "type": "github" } ], - "time": "2023-09-25T17:07:54+00:00" + "time": "2023-10-24T15:00:59+00:00" }, { "name": "sebastian/cli-parser", @@ -8907,16 +8909,16 @@ }, { "name": "symfony/yaml", - "version": "v6.3.3", + "version": "v6.3.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e23292e8c07c85b971b44c1c4b87af52133e2add" + "reference": "9758b6c69d179936435d0ffb577c3708d57e38a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e23292e8c07c85b971b44c1c4b87af52133e2add", - "reference": "e23292e8c07c85b971b44c1c4b87af52133e2add", + "url": "https://api.github.com/repos/symfony/yaml/zipball/9758b6c69d179936435d0ffb577c3708d57e38a8", + "reference": "9758b6c69d179936435d0ffb577c3708d57e38a8", "shasum": "" }, "require": { @@ -8959,7 +8961,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.3.3" + "source": "https://github.com/symfony/yaml/tree/v6.3.7" }, "funding": [ { @@ -8975,7 +8977,7 @@ "type": "tidelift" } ], - "time": "2023-07-31T07:08:24+00:00" + "time": "2023-10-28T23:31:00+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/Commands/Translate.php b/src/Commands/Translate.php index 1ae7fb5..85f4130 100644 --- a/src/Commands/Translate.php +++ b/src/Commands/Translate.php @@ -4,6 +4,8 @@ use Carbon\Carbon; use Illuminate\Console\Command; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Query\Builder; use Illuminate\Support\Collection; use Illuminate\Support\Facades\File; use Illuminate\Support\Str; @@ -471,15 +473,28 @@ private static function modelsTranslationKeys(): Collection * @var Collection */ $keys = collect($models) - ->map(function (string $column, string $model): Collection { + ->map(function (string|array $columns, string $model): Collection { + if (is_string($columns)) { + /** + * @var Collection + * + * @phpstan-ignore-next-line Parameter #1 $callback of function call_user_func expects callable(): mixed, array{string, 'pluck'} given. + */ + return call_user_func([$model, "pluck"], $columns); + } + /** @phpstan-ignore-next-line Parameter #1 $callback of function call_user_func expects callable(): mixed, array{string, 'query'} given. */ + $query = call_user_func([$model, "query"]); + + assert($query instanceof Builder); + /** * @var Collection - * - * @phpstan-ignore-next-line Parameter #1 $callback of function call_user_func expects callable(): mixed, array{string, 'pluck'} given. */ - $keys = call_user_func([$model, "pluck"], $column); - - return $keys; + return $query->select($columns) + ->get() + /** @phpstan-ignore-next-line Parameter #1 $callback of method Illuminate\Support\Collection<(int|string),mixed>::map() expects callable(mixed, int|string): array, Closure(Illuminate\Database\Eloquent\Model): array given. */ + ->map(fn (Model $model): array => $model->toArray()) + ->flatten(); }) ->flatten(); diff --git a/tests/Feature/Commands/TranslateTest.php b/tests/Feature/Commands/TranslateTest.php index 944f4e7..dd5aa29 100644 --- a/tests/Feature/Commands/TranslateTest.php +++ b/tests/Feature/Commands/TranslateTest.php @@ -321,13 +321,47 @@ public function testCanAddNewKeyFoundFromModelsData(): void ], ]); + $this->artisan(Translate::class) + ->assertSuccessful(); + + $this->assertFileContainsExactJson(__DIR__ . "/../../misc/resources/lang/fr.json", [ + "Adventure" => "", + "Drama" => "", + "Fantastic" => "", + ]); + } + + public function testCanAddNewKeyFoundFromMultipleColumnsOfASingleModel(): void + { + $this->seed(BookTypeSeeder::class); + + $this->app?->useLangPath(__DIR__ . "/../../misc/resources/lang"); + + config([ + "translate" => [ + "langs" => [ + "fr", + ], + "include" => [], + "models" => [ + BookType::class => [ + "name", + "description", + ], + ], + ], + ]); + $this->artisan(Translate::class) ->assertSuccessful(); $this->assertFileContainsExactJson(__DIR__ . "/../../misc/resources/lang/fr.json", [ "Drama" => "", + "Intense human conflicts and emotions." => "", "Fantastic" => "", + "Magical worlds and creatures." => "", "Adventure" => "", + "Thrilling quests and daring journeys." => "", ]); } @@ -360,9 +394,9 @@ public function testCanRemoveUnusedKeysWhenNewKeysFoundFromModelsData(): void ->assertSuccessful(); $this->assertFileContainsExactJson(__DIR__ . "/../../misc/resources/lang/fr.json", [ + "Adventure" => "", "Drama" => "", "Fantastic" => "", - "Adventure" => "", ]); } @@ -395,9 +429,9 @@ public function testKeepsKeysUnusedWhenFindingKeysFromModelsData(): void ->assertSuccessful(); $this->assertFileContainsExactJson(__DIR__ . "/../../misc/resources/lang/fr.json", [ + "Adventure" => "", "Drama" => "", "Fantastic" => "", - "Adventure" => "", "Book copied." => "", ]); } diff --git a/tests/misc/database/migrations/2023_03_08_211000_create_book_types_table.php b/tests/misc/database/migrations/2023_03_08_211000_create_book_types_table.php index 95097ba..96310ef 100644 --- a/tests/misc/database/migrations/2023_03_08_211000_create_book_types_table.php +++ b/tests/misc/database/migrations/2023_03_08_211000_create_book_types_table.php @@ -10,6 +10,7 @@ public function up(): void Schema::create("book_types", function (Blueprint $table): void { $table->id(); $table->string("name")->unique(); + $table->string("description"); }); } diff --git a/tests/misc/database/seeders/BookTypeSeeder.php b/tests/misc/database/seeders/BookTypeSeeder.php index c9b6c38..6a7c9ee 100644 --- a/tests/misc/database/seeders/BookTypeSeeder.php +++ b/tests/misc/database/seeders/BookTypeSeeder.php @@ -13,14 +13,17 @@ public function run(): void [ "id" => BookType::DRAMA, "name" => "Drama", + "description" => "Intense human conflicts and emotions.", ], [ "id" => BookType::FANTASTIC, "name" => "Fantastic", + "description" => "Magical worlds and creatures.", ], [ "id" => BookType::ADVENTURE, "name" => "Adventure", + "description" => "Thrilling quests and daring journeys.", ], ]); }