From bbe0f8678f2a3528c1b021a45bd09839cfd801d7 Mon Sep 17 00:00:00 2001 From: Iosif Chatzimichail Date: Thu, 14 Mar 2024 20:31:10 +0200 Subject: [PATCH] Hooks work --- composer.lock | 301 ++++++++++++----------- src/Http/Livewire/LivewireCollection.php | 4 +- tests/Feature/HooksTest.php | 63 +++++ tests/TestCase.php | 2 +- 4 files changed, 221 insertions(+), 149 deletions(-) create mode 100644 tests/Feature/HooksTest.php diff --git a/composer.lock b/composer.lock index d9e74e7..c7db103 100644 --- a/composer.lock +++ b/composer.lock @@ -195,16 +195,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "3ce240142f6d59b808dd65c1f52f7a1c252e6cfd" + "reference": "18fc0ab083a48f85bfee31f3786537353b8a8403" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/3ce240142f6d59b808dd65c1f52f7a1c252e6cfd", - "reference": "3ce240142f6d59b808dd65c1f52f7a1c252e6cfd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/18fc0ab083a48f85bfee31f3786537353b8a8403", + "reference": "18fc0ab083a48f85bfee31f3786537353b8a8403", "shasum": "" }, "require": { @@ -251,7 +251,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.4.1" + "source": "https://github.com/composer/ca-bundle/tree/1.4.2" }, "funding": [ { @@ -267,7 +267,7 @@ "type": "tidelift" } ], - "time": "2024-02-23T10:16:52+00:00" + "time": "2024-03-14T13:20:33+00:00" }, { "name": "composer/class-map-generator", @@ -344,16 +344,16 @@ }, { "name": "composer/composer", - "version": "2.7.1", + "version": "2.7.2", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "aaf6ed5ccd27c23f79a545e351b4d7842a99d0bc" + "reference": "b826edb791571ab1eaf281eb1bd6e181a1192adc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/aaf6ed5ccd27c23f79a545e351b4d7842a99d0bc", - "reference": "aaf6ed5ccd27c23f79a545e351b4d7842a99d0bc", + "url": "https://api.github.com/repos/composer/composer/zipball/b826edb791571ab1eaf281eb1bd6e181a1192adc", + "reference": "b826edb791571ab1eaf281eb1bd6e181a1192adc", "shasum": "" }, "require": { @@ -438,7 +438,7 @@ "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.7.1" + "source": "https://github.com/composer/composer/tree/2.7.2" }, "funding": [ { @@ -454,7 +454,7 @@ "type": "tidelift" } ], - "time": "2024-02-09T14:26:28+00:00" + "time": "2024-03-11T16:12:18+00:00" }, { "name": "composer/metadata-minifier", @@ -527,16 +527,16 @@ }, { "name": "composer/pcre", - "version": "3.1.1", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" + "reference": "4775f35b2d70865807c89d32c8e7385b86eb0ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "url": "https://api.github.com/repos/composer/pcre/zipball/4775f35b2d70865807c89d32c8e7385b86eb0ace", + "reference": "4775f35b2d70865807c89d32c8e7385b86eb0ace", "shasum": "" }, "require": { @@ -578,7 +578,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.1" + "source": "https://github.com/composer/pcre/tree/3.1.2" }, "funding": [ { @@ -594,7 +594,7 @@ "type": "tidelift" } ], - "time": "2023-10-11T07:11:09+00:00" + "time": "2024-03-07T15:38:35+00:00" }, { "name": "composer/semver", @@ -1944,20 +1944,20 @@ }, { "name": "jonassiewertsen/statamic-livewire", - "version": "v3.0.0", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/jonassiewertsen/statamic-livewire.git", - "reference": "aa890f166e40aeec8474d75e2e08b5fb72c89ead" + "reference": "d098fc294ede6588bd717dc3eb0aa4647a209411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jonassiewertsen/statamic-livewire/zipball/aa890f166e40aeec8474d75e2e08b5fb72c89ead", - "reference": "aa890f166e40aeec8474d75e2e08b5fb72c89ead", + "url": "https://api.github.com/repos/jonassiewertsen/statamic-livewire/zipball/d098fc294ede6588bd717dc3eb0aa4647a209411", + "reference": "d098fc294ede6588bd717dc3eb0aa4647a209411", "shasum": "" }, "require": { - "illuminate/support": "^10.0", + "illuminate/support": "^10.0|^11.0", "livewire/livewire": "^3.0", "php": "^8.1", "statamic/cms": "^4.23.2" @@ -1999,7 +1999,7 @@ "support": { "docs": "https://github.com/jonassiewertsen/statamic-livewire", "issues": "https://github.com/jonassiewertsen/statamic-livewire/issues", - "source": "https://github.com/jonassiewertsen/statamic-livewire/tree/v3.0.0" + "source": "https://github.com/jonassiewertsen/statamic-livewire/tree/v3.1.0" }, "funding": [ { @@ -2007,7 +2007,7 @@ "type": "github" } ], - "time": "2023-10-03T11:21:01+00:00" + "time": "2024-03-08T09:17:11+00:00" }, { "name": "justinrainbow/json-schema", @@ -2139,16 +2139,16 @@ }, { "name": "laravel/framework", - "version": "v10.46.0", + "version": "v10.48.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "5e95946a8283a8d5c015035793f9c61c297e937f" + "reference": "32a8bb151d748b579c3794dea53b56bd40dfbbd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/5e95946a8283a8d5c015035793f9c61c297e937f", - "reference": "5e95946a8283a8d5c015035793f9c61c297e937f", + "url": "https://api.github.com/repos/laravel/framework/zipball/32a8bb151d748b579c3794dea53b56bd40dfbbd3", + "reference": "32a8bb151d748b579c3794dea53b56bd40dfbbd3", "shasum": "" }, "require": { @@ -2196,6 +2196,7 @@ "conflict": { "carbonphp/carbon-doctrine-types": ">=3.0", "doctrine/dbal": ">=4.0", + "mockery/mockery": "1.6.8", "phpunit/phpunit": ">=11.0.0", "tightenco/collect": "<5.5.33" }, @@ -2341,7 +2342,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-02-27T16:46:54+00:00" + "time": "2024-03-12T16:35:43+00:00" }, { "name": "laravel/helpers", @@ -2796,16 +2797,16 @@ }, { "name": "league/flysystem", - "version": "3.24.0", + "version": "3.25.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "b25a361508c407563b34fac6f64a8a17a8819675" + "reference": "4c44347133618cccd9b3df1729647a1577b4ad99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b25a361508c407563b34fac6f64a8a17a8819675", - "reference": "b25a361508c407563b34fac6f64a8a17a8819675", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4c44347133618cccd9b3df1729647a1577b4ad99", + "reference": "4c44347133618cccd9b3df1729647a1577b4ad99", "shasum": "" }, "require": { @@ -2833,7 +2834,7 @@ "friendsofphp/php-cs-fixer": "^3.5", "google/cloud-storage": "^1.23", "microsoft/azure-storage-blob": "^1.1", - "phpseclib/phpseclib": "^3.0.34", + "phpseclib/phpseclib": "^3.0.36", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.5.11|^10.0", "sabre/dav": "^4.6.0" @@ -2870,7 +2871,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.24.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.25.0" }, "funding": [ { @@ -2882,7 +2883,7 @@ "type": "github" } ], - "time": "2024-02-04T12:10:17+00:00" + "time": "2024-03-09T17:06:45+00:00" }, { "name": "league/flysystem-local", @@ -3067,16 +3068,16 @@ }, { "name": "livewire/livewire", - "version": "v3.4.6", + "version": "v3.4.9", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "7e7d638183b34fb61621455891869f5abfd55a82" + "reference": "c65b3f0798ab2c9338213ede3588c3cdf4e6fcc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/7e7d638183b34fb61621455891869f5abfd55a82", - "reference": "7e7d638183b34fb61621455891869f5abfd55a82", + "url": "https://api.github.com/repos/livewire/livewire/zipball/c65b3f0798ab2c9338213ede3588c3cdf4e6fcc0", + "reference": "c65b3f0798ab2c9338213ede3588c3cdf4e6fcc0", "shasum": "" }, "require": { @@ -3130,7 +3131,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v3.4.6" + "source": "https://github.com/livewire/livewire/tree/v3.4.9" }, "funding": [ { @@ -3138,7 +3139,7 @@ "type": "github" } ], - "time": "2024-02-20T14:04:25+00:00" + "time": "2024-03-14T14:03:32+00:00" }, { "name": "maennchen/zipstream-php", @@ -5195,16 +5196,16 @@ }, { "name": "statamic/cms", - "version": "v4.51.0", + "version": "v4.53.2", "source": { "type": "git", "url": "https://github.com/statamic/cms.git", - "reference": "d2dc38494d672fcff6e962f0a4742763d33dd49b" + "reference": "b96672b83ad7211496dc42a5db33470e457c0628" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/statamic/cms/zipball/d2dc38494d672fcff6e962f0a4742763d33dd49b", - "reference": "d2dc38494d672fcff6e962f0a4742763d33dd49b", + "url": "https://api.github.com/repos/statamic/cms/zipball/b96672b83ad7211496dc42a5db33470e457c0628", + "reference": "b96672b83ad7211496dc42a5db33470e457c0628", "shasum": "" }, "require": { @@ -5287,7 +5288,7 @@ ], "support": { "issues": "https://github.com/statamic/cms/issues", - "source": "https://github.com/statamic/cms/tree/v4.51.0" + "source": "https://github.com/statamic/cms/tree/v4.53.2" }, "funding": [ { @@ -5295,7 +5296,7 @@ "type": "github" } ], - "time": "2024-02-28T15:24:29+00:00" + "time": "2024-03-13T13:59:57+00:00" }, { "name": "statamic/stringy", @@ -6028,16 +6029,16 @@ }, { "name": "symfony/http-kernel", - "version": "v6.4.4", + "version": "v6.4.5", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "7a186f64a7f02787c04e8476538624d6aa888e42" + "reference": "f6947cb939d8efee137797382cb4db1af653ef75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/7a186f64a7f02787c04e8476538624d6aa888e42", - "reference": "7a186f64a7f02787c04e8476538624d6aa888e42", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f6947cb939d8efee137797382cb4db1af653ef75", + "reference": "f6947cb939d8efee137797382cb4db1af653ef75", "shasum": "" }, "require": { @@ -6121,7 +6122,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.4.4" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.5" }, "funding": [ { @@ -6137,7 +6138,7 @@ "type": "tidelift" } ], - "time": "2024-02-27T06:32:13+00:00" + "time": "2024-03-04T21:00:47+00:00" }, { "name": "symfony/lock", @@ -7308,16 +7309,16 @@ }, { "name": "symfony/routing", - "version": "v6.4.3", + "version": "v6.4.5", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842" + "reference": "7fe30068e207d9c31c0138501ab40358eb2d49a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/3b2957ad54902f0f544df83e3d58b38d7e8e5842", - "reference": "3b2957ad54902f0f544df83e3d58b38d7e8e5842", + "url": "https://api.github.com/repos/symfony/routing/zipball/7fe30068e207d9c31c0138501ab40358eb2d49a4", + "reference": "7fe30068e207d9c31c0138501ab40358eb2d49a4", "shasum": "" }, "require": { @@ -7371,7 +7372,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.3" + "source": "https://github.com/symfony/routing/tree/v6.4.5" }, "funding": [ { @@ -7387,7 +7388,7 @@ "type": "tidelift" } ], - "time": "2024-01-30T13:55:02+00:00" + "time": "2024-02-27T12:33:30+00:00" }, { "name": "symfony/service-contracts", @@ -8875,7 +8876,7 @@ }, { "name": "mockery/mockery", - "version": "1.6.7", + "version": "1.6.9", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", @@ -9164,16 +9165,16 @@ }, { "name": "orchestra/testbench", - "version": "v8.21.1", + "version": "v8.22.0", "source": { "type": "git", "url": "https://github.com/orchestral/testbench.git", - "reference": "c22a81802a68e746e032edf65cbb68af28a52670" + "reference": "77e857d3f57c892dbe76e71d4212f5f03a66887f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/c22a81802a68e746e032edf65cbb68af28a52670", - "reference": "c22a81802a68e746e032edf65cbb68af28a52670", + "url": "https://api.github.com/repos/orchestral/testbench/zipball/77e857d3f57c892dbe76e71d4212f5f03a66887f", + "reference": "77e857d3f57c892dbe76e71d4212f5f03a66887f", "shasum": "" }, "require": { @@ -9181,8 +9182,8 @@ "fakerphp/faker": "^1.21", "laravel/framework": "^10.40", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^8.21.1", - "orchestra/workbench": "^1.2 || ^8.2", + "orchestra/testbench-core": "^8.23", + "orchestra/workbench": "^1.4 || ^8.4", "php": "^8.1", "phpunit/phpunit": "^9.6 || ^10.1", "symfony/process": "^6.2", @@ -9213,22 +9214,22 @@ ], "support": { "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench/tree/v8.21.1" + "source": "https://github.com/orchestral/testbench/tree/v8.22.0" }, - "time": "2024-01-22T03:22:22+00:00" + "time": "2024-03-13T06:52:48+00:00" }, { "name": "orchestra/testbench-core", - "version": "v8.22.1", + "version": "v8.23.0", "source": { "type": "git", "url": "https://github.com/orchestral/testbench-core.git", - "reference": "b0006c092694828f4b0fa409a369b798e5e26f8d" + "reference": "35936ff29b42439fda75dbb635cc57e113f17c98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/b0006c092694828f4b0fa409a369b798e5e26f8d", - "reference": "b0006c092694828f4b0fa409a369b798e5e26f8d", + "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/35936ff29b42439fda75dbb635cc57e113f17c98", + "reference": "35936ff29b42439fda75dbb635cc57e113f17c98", "shasum": "" }, "require": { @@ -9238,7 +9239,7 @@ }, "conflict": { "brianium/paratest": "<6.4.0 || >=7.0.0 <7.1.4 || >=8.0.0", - "laravel/framework": "<10.40 || >=11.0.0", + "laravel/framework": "<10.48.2 || >=11.0.0", "nunomaduro/collision": "<6.4.0 || >=7.0.0 <7.4.0 || >=8.0.0", "orchestra/testbench-dusk": "<8.21.0 || >=9.0.0", "orchestra/workbench": "<1.0.0", @@ -9246,7 +9247,7 @@ }, "require-dev": { "fakerphp/faker": "^1.21", - "laravel/framework": "^10.40", + "laravel/framework": "^10.48.2", "laravel/pint": "^1.6", "mockery/mockery": "^1.5.1", "phpstan/phpstan": "^1.10.7", @@ -9260,7 +9261,7 @@ "brianium/paratest": "Allow using parallel testing (^6.4 || ^7.1.4).", "ext-pcntl": "Required to use all features of the console signal trapping.", "fakerphp/faker": "Allow using Faker for testing (^1.21).", - "laravel/framework": "Required for testing (^10.40).", + "laravel/framework": "Required for testing (^10.48.2).", "mockery/mockery": "Allow using Mockery for testing (^1.5.1).", "nunomaduro/collision": "Allow using Laravel style tests output and parallel testing (^6.4 || ^7.4).", "orchestra/testbench-browser-kit": "Allow using legacy Laravel BrowserKit for testing (^8.0).", @@ -9307,20 +9308,20 @@ "issues": "https://github.com/orchestral/testbench/issues", "source": "https://github.com/orchestral/testbench-core" }, - "time": "2024-02-21T23:33:22+00:00" + "time": "2024-03-13T04:02:37+00:00" }, { "name": "orchestra/workbench", - "version": "v8.2.1", + "version": "v8.4.0", "source": { "type": "git", "url": "https://github.com/orchestral/workbench.git", - "reference": "e8e6e4dcf6fb26ea1924c3581e49aa347691a8ea" + "reference": "7db7009377fd1afe25c783e9092af911cd04b3a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/workbench/zipball/e8e6e4dcf6fb26ea1924c3581e49aa347691a8ea", - "reference": "e8e6e4dcf6fb26ea1924c3581e49aa347691a8ea", + "url": "https://api.github.com/repos/orchestral/workbench/zipball/7db7009377fd1afe25c783e9092af911cd04b3a9", + "reference": "7db7009377fd1afe25c783e9092af911cd04b3a9", "shasum": "" }, "require": { @@ -9329,7 +9330,7 @@ "laravel/framework": "^10.38.1", "laravel/tinker": "^2.8.2", "orchestra/canvas": "^8.11.4", - "orchestra/testbench-core": "^8.17", + "orchestra/testbench-core": "^8.22", "php": "^8.1", "spatie/laravel-ray": "^1.32.4", "symfony/polyfill-php83": "^1.28", @@ -9375,26 +9376,27 @@ ], "support": { "issues": "https://github.com/orchestral/workbench/issues", - "source": "https://github.com/orchestral/workbench/tree/v8.2.1" + "source": "https://github.com/orchestral/workbench/tree/v8.4.0" }, - "time": "2023-12-28T15:15:44+00:00" + "time": "2024-03-13T06:02:29+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -9435,9 +9437,15 @@ "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/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -9492,16 +9500,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.59", + "version": "1.10.62", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e607609388d3a6d418a50a49f7940e8086798281" + "reference": "cd5c8a1660ed3540b211407c77abf4af193a6af9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e607609388d3a6d418a50a49f7940e8086798281", - "reference": "e607609388d3a6d418a50a49f7940e8086798281", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cd5c8a1660ed3540b211407c77abf4af193a6af9", + "reference": "cd5c8a1660ed3540b211407c77abf4af193a6af9", "shasum": "" }, "require": { @@ -9550,20 +9558,20 @@ "type": "tidelift" } ], - "time": "2024-02-20T13:59:13+00:00" + "time": "2024-03-13T12:27:20+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "10.1.11", + "version": "10.1.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145" + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", "shasum": "" }, "require": { @@ -9620,7 +9628,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.11" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.14" }, "funding": [ { @@ -9628,7 +9636,7 @@ "type": "github" } ], - "time": "2023-12-21T15:38:30+00:00" + "time": "2024-03-12T15:33:41+00:00" }, { "name": "phpunit/php-file-iterator", @@ -9875,16 +9883,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.11", + "version": "10.5.13", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0d968f6323deb3dbfeba5bfd4929b9415eb7a9a4" + "reference": "20a63fc1c6db29b15da3bd02d4b6cf59900088a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0d968f6323deb3dbfeba5bfd4929b9415eb7a9a4", - "reference": "0d968f6323deb3dbfeba5bfd4929b9415eb7a9a4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/20a63fc1c6db29b15da3bd02d4b6cf59900088a7", + "reference": "20a63fc1c6db29b15da3bd02d4b6cf59900088a7", "shasum": "" }, "require": { @@ -9956,7 +9964,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.5.11" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.13" }, "funding": [ { @@ -9972,7 +9980,7 @@ "type": "tidelift" } ], - "time": "2024-02-25T14:05:00+00:00" + "time": "2024-03-12T15:37:41+00:00" }, { "name": "pimple/pimple", @@ -10108,16 +10116,16 @@ }, { "name": "rector/rector", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "258b775511e62a7188f8ce114d44acaf244d9a7d" + "reference": "c59507a9090b465d65e1aceed91e5b81986e375b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/258b775511e62a7188f8ce114d44acaf244d9a7d", - "reference": "258b775511e62a7188f8ce114d44acaf244d9a7d", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/c59507a9090b465d65e1aceed91e5b81986e375b", + "reference": "c59507a9090b465d65e1aceed91e5b81986e375b", "shasum": "" }, "require": { @@ -10152,7 +10160,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/1.0.1" + "source": "https://github.com/rectorphp/rector/tree/1.0.3" }, "funding": [ { @@ -10160,20 +10168,20 @@ "type": "github" } ], - "time": "2024-02-16T07:53:23+00:00" + "time": "2024-03-14T15:04:18+00:00" }, { "name": "sebastian/cli-parser", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { @@ -10208,7 +10216,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -10216,7 +10225,7 @@ "type": "github" } ], - "time": "2023-02-03T06:58:15+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", @@ -10466,16 +10475,16 @@ }, { "name": "sebastian/diff", - "version": "5.1.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { @@ -10483,7 +10492,7 @@ }, "require-dev": { "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" + "symfony/process": "^6.4" }, "type": "library", "extra": { @@ -10521,7 +10530,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -10529,7 +10538,7 @@ "type": "github" } ], - "time": "2023-12-22T10:55:06+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", @@ -10597,16 +10606,16 @@ }, { "name": "sebastian/exporter", - "version": "5.1.1", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { @@ -10663,7 +10672,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -10671,20 +10680,20 @@ "type": "github" } ], - "time": "2023-09-24T13:22:09+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { @@ -10718,14 +10727,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -10733,7 +10742,7 @@ "type": "github" } ], - "time": "2023-07-19T07:19:23+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", @@ -11500,16 +11509,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -11538,7 +11547,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/1.2.2" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -11546,7 +11555,7 @@ "type": "github" } ], - "time": "2023-11-20T00:12:19+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "zbateson/mail-mime-parser", diff --git a/src/Http/Livewire/LivewireCollection.php b/src/Http/Livewire/LivewireCollection.php index 11a4d2d..5f48742 100644 --- a/src/Http/Livewire/LivewireCollection.php +++ b/src/Http/Livewire/LivewireCollection.php @@ -6,12 +6,12 @@ use Livewire\Attributes\Locked; use Livewire\Attributes\On; use Livewire\Component; -use Statamic\Tags\Collection\Entries; use Statamic\Support\Traits\Hookable; +use Statamic\Tags\Collection\Entries; class LivewireCollection extends Component { - use Traits\GenerateParams, Traits\HandleParams, WithPagination, Hookable; + use Hookable, Traits\GenerateParams, Traits\HandleParams, WithPagination; public $params; diff --git a/tests/Feature/HooksTest.php b/tests/Feature/HooksTest.php new file mode 100644 index 0000000..bfe903c --- /dev/null +++ b/tests/Feature/HooksTest.php @@ -0,0 +1,63 @@ +music = Facades\Collection::make('music')->save(); + $this->makePosts(); + } + + protected function makeEntry($collection, $slug) + { + return EntryFactory::id($slug)->collection($collection)->slug($slug)->make(); + } + + protected function makePosts() + { + $this->makeEntry($this->music, 'a')->set('title', 'I Love Guitars')->save(); + $this->makeEntry($this->music, 'b')->set('title', 'I Love Drums')->save(); + $this->makeEntry($this->music, 'c')->set('title', 'I Hate Flutes')->save(); + } + + /** @test */ + public function it_can_hook_into_livewire_fetched_entries() + { + $this->withFakeViews(); + + $this->viewShouldReturnRaw('statamic-livewire-filters::livewire.livewire-collection', '
{{ entries }} {{ bands }} {{ /entries }}
'); + + LivewireCollection::hook('livewire-fetched-entries', function ($entries, $next) { + $entries->transform(function ($entry) { + return $entry->set('bands', 'I Love Rush!'); + }); + + return $next($entries); + }); + + $params = [ + 'from' => 'music', + 'title:is' => 'I Love Guitars', + ]; + + Livewire::test(LivewireCollection::class, ['params' => $params]) + ->assertSee('I Love Rush!'); + + } +} diff --git a/tests/TestCase.php b/tests/TestCase.php index 3dabe74..7105ba8 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -56,7 +56,7 @@ protected function resolveApplicationConfiguration($app) ]; foreach ($configs as $config) { - $app['config']->set("statamic.$config", require(__DIR__."/../vendor/statamic/cms/config/{$config}.php")); + $app['config']->set("statamic.$config", require (__DIR__."/../vendor/statamic/cms/config/{$config}.php")); } }