diff --git a/composer.lock b/composer.lock index cff4cb07..9079f301 100644 --- a/composer.lock +++ b/composer.lock @@ -1056,16 +1056,16 @@ }, { "name": "laravel/framework", - "version": "v11.32.0", + "version": "v11.33.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "bc2aad63f83ee5089be7b21cf29d645ccf31e927" + "reference": "6b9832751cf8eed18b3c73df5071f78f0682aa5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/bc2aad63f83ee5089be7b21cf29d645ccf31e927", - "reference": "bc2aad63f83ee5089be7b21cf29d645ccf31e927", + "url": "https://api.github.com/repos/laravel/framework/zipball/6b9832751cf8eed18b3c73df5071f78f0682aa5d", + "reference": "6b9832751cf8eed18b3c73df5071f78f0682aa5d", "shasum": "" }, "require": { @@ -1085,7 +1085,7 @@ "guzzlehttp/guzzle": "^7.8", "guzzlehttp/uri-template": "^1.0", "laravel/prompts": "^0.1.18|^0.2.0|^0.3.0", - "laravel/serializable-closure": "^1.3", + "laravel/serializable-closure": "^1.3|^2.0", "league/commonmark": "^2.2.1", "league/flysystem": "^3.8.0", "monolog/monolog": "^3.0", @@ -1168,9 +1168,9 @@ "league/flysystem-path-prefixing": "^3.3", "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", - "mockery/mockery": "^1.6", + "mockery/mockery": "^1.6.10", "nyholm/psr7": "^1.2", - "orchestra/testbench-core": "^9.5", + "orchestra/testbench-core": "^9.6", "pda/pheanstalk": "^5.0", "phpstan/phpstan": "^1.11.5", "phpunit/phpunit": "^10.5|^11.0", @@ -1261,7 +1261,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-11-15T17:04:33+00:00" + "time": "2024-11-19T22:47:13+00:00" }, { "name": "laravel/prompts", @@ -1324,32 +1324,32 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.3.6", + "version": "v2.0.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "f865a58ea3a0107c336b7045104c75243fa59d96" + "reference": "0d8d3d8086984996df86596a86dea60398093a81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f865a58ea3a0107c336b7045104c75243fa59d96", - "reference": "f865a58ea3a0107c336b7045104c75243fa59d96", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/0d8d3d8086984996df86596a86dea60398093a81", + "reference": "0d8d3d8086984996df86596a86dea60398093a81", "shasum": "" }, "require": { - "php": "^7.3|^8.0" + "php": "^8.1" }, "require-dev": { - "illuminate/support": "^8.0|^9.0|^10.0|^11.0", - "nesbot/carbon": "^2.61|^3.0", - "pestphp/pest": "^1.21.3", - "phpstan/phpstan": "^1.8.2", - "symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0" + "illuminate/support": "^10.0|^11.0", + "nesbot/carbon": "^2.67|^3.0", + "pestphp/pest": "^2.36", + "phpstan/phpstan": "^2.0", + "symfony/var-dumper": "^6.2.0|^7.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -1381,7 +1381,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2024-11-11T17:06:04+00:00" + "time": "2024-11-19T01:38:44+00:00" }, { "name": "league/commonmark", @@ -5280,16 +5280,16 @@ }, { "name": "voku/portable-ascii", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "b56450eed252f6801410d810c8e1727224ae0743" + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", - "reference": "b56450eed252f6801410d810c8e1727224ae0743", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", "shasum": "" }, "require": { @@ -5314,7 +5314,7 @@ "authors": [ { "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" + "homepage": "https://www.moelleken.org/" } ], "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", @@ -5326,7 +5326,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/2.0.1" + "source": "https://github.com/voku/portable-ascii/tree/2.0.3" }, "funding": [ { @@ -5350,7 +5350,7 @@ "type": "tidelift" } ], - "time": "2022-03-08T17:03:00+00:00" + "time": "2024-11-21T01:49:47+00:00" }, { "name": "webmozart/assert", @@ -5633,20 +5633,20 @@ }, { "name": "laravel/laravel", - "version": "v11.3.2", + "version": "v11.3.3", "source": { "type": "git", "url": "https://github.com/laravel/laravel.git", - "reference": "82a83a698134278da35d67b102f3e985b2d2502b" + "reference": "2eacb3d0f08a401ff70107c7a617e27478fb576d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/laravel/zipball/82a83a698134278da35d67b102f3e985b2d2502b", - "reference": "82a83a698134278da35d67b102f3e985b2d2502b", + "url": "https://api.github.com/repos/laravel/laravel/zipball/2eacb3d0f08a401ff70107c7a617e27478fb576d", + "reference": "2eacb3d0f08a401ff70107c7a617e27478fb576d", "shasum": "" }, "require": { - "laravel/framework": "^11.9", + "laravel/framework": "^11.31", "laravel/tinker": "^2.9", "php": "^8.2" }, @@ -5682,22 +5682,22 @@ "laravel" ], "support": { - "source": "https://github.com/laravel/laravel/tree/v11.3.2" + "source": "https://github.com/laravel/laravel/tree/v11.3.3" }, - "time": "2024-10-21T13:59:43+00:00" + "time": "2024-11-18T14:18:44+00:00" }, { "name": "laravel/pint", - "version": "v1.18.1", + "version": "v1.18.2", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "url": "https://api.github.com/repos/laravel/pint/zipball/f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", + "reference": "f55daaf7eb6c2f49ddf6702fb42e3091c64d8a64", "shasum": "" }, "require": { @@ -5750,7 +5750,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-09-24T17:22:50+00:00" + "time": "2024-11-20T09:33:46+00:00" }, { "name": "laravel/tinker", diff --git a/resources/js/app.js b/resources/js/app.js index 7d421acd..6ddcbb22 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -26,6 +26,7 @@ window.$http = Axios.create({ // Cookie window.$cookie = new Cookie('__root_'); +// Handle the relation frame load event document.addEventListener('relation-frame-loaded', (event) => { if (window.location.href !== event.detail.url) { window.history.replaceState(window.history.state, document.title, event.detail.url); diff --git a/src/Fields/Relation.php b/src/Fields/Relation.php index 5f10e21c..c51b98ba 100644 --- a/src/Fields/Relation.php +++ b/src/Fields/Relation.php @@ -632,9 +632,10 @@ public function paginate(Request $request, Model $model): LengthAwarePaginator ->withCount($this->withCount) ->latest() ->paginate( - $request->input($this->getPerPageKey(), $request->isTurboFrameRequest() - ? 5 - : $relation->getRelated()->getPerPage()) + $request->input( + $this->getPerPageKey(), + $request->isTurboFrameRequest() ? 5 : $relation->getRelated()->getPerPage() + ) )->withQueryString(); } @@ -875,9 +876,10 @@ public function routes(Router $router): void public function registerRouteConstraints(Request $request, Router $router): void { $router->bind($this->getRouteKeyName(), function (string $id, Route $route) use ($router): Model { - return $id === 'create' - ? $this->getRelation($route->parentOfParameter($this->getRouteKeyName()))->make() - : $this->resolveRouteBinding($router->getCurrentRequest(), $id); + return match ($id) { + 'create' => $this->getRelation($route->parentOfParameter($this->getRouteKeyName()))->make(), + default => $this->resolveRouteBinding($router->getCurrentRequest(), $id), + }; }); }