From 9cda94051e1779e17d6683245d3c10a16978d342 Mon Sep 17 00:00:00 2001 From: Philip Iezzi Date: Fri, 8 Nov 2024 13:30:08 +0100 Subject: [PATCH 1/3] workaround to get Gretel working with Inertia v2 until https://github.com/inertiajs/inertia-laravel/pull/678 is merged --- src/Support/GretelServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Support/GretelServiceProvider.php b/src/Support/GretelServiceProvider.php index 728a1d9..25878d0 100755 --- a/src/Support/GretelServiceProvider.php +++ b/src/Support/GretelServiceProvider.php @@ -137,8 +137,8 @@ protected function bootThirdParty(): self $packages = $config->get('gretel.packages', []); if (Arr::get($packages, 'inertiajs/inertia-laravel') && class_exists(Inertia::class)) { - Inertia::share('breadcrumbs', static function(Request $request) { - if ($route = $request->route()) { + Inertia::share('breadcrumbs', static function() { + if ($route = request()->route()) { return $route->breadcrumbs()->jsonSerialize(); } return []; From 524b3653b8aa747cdcb44ba5d2cd833f94500e10 Mon Sep 17 00:00:00 2001 From: Philip Iezzi Date: Sat, 7 Dec 2024 23:28:33 +0100 Subject: [PATCH 2/3] Support laravel/serializable-closure v2.0 for PHP 8.4 Drop legacy Laravel versions --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 5bcfa98..1074586 100755 --- a/composer.json +++ b/composer.json @@ -14,16 +14,16 @@ "type": "library", "license": "MIT", "require": { - "illuminate/support": "^8|^9|^10|^11|12.x-dev|dev-master", - "illuminate/routing": "^8|^9|^10|^11|12.x-dev|dev-master", - "illuminate/view": "^8|^9|^10|^11|12.x-dev|dev-master", - "laravel/serializable-closure": "^1.0" + "illuminate/support": "^10|^11|12.x-dev|dev-master", + "illuminate/routing": "^10|^11|12.x-dev|dev-master", + "illuminate/view": "^10|^11|12.x-dev|dev-master", + "laravel/serializable-closure": "^1.0|^2.0" }, "require-dev": { - "orchestra/testbench": "^6.24|^7.10|^8|^9|9.x-dev|10.x-dev|dev-master", + "orchestra/testbench": "^8|^9|9.x-dev|10.x-dev|dev-master", "friendsofphp/php-cs-fixer": "^3.0", "mockery/mockery": "^1.3", - "phpunit/phpunit": "^9.5|^10.5" + "phpunit/phpunit": "^10.5" }, "autoload": { "psr-4": { From 107993a812e712e3f8dff0abf70c2156f51961fb Mon Sep 17 00:00:00 2001 From: Philip Iezzi Date: Fri, 13 Dec 2024 23:49:21 +0100 Subject: [PATCH 3/3] Revert 9cda940 as the issue is now fixed in Inertia v2.0.0 since https://github.com/inertiajs/inertia-laravel/commit/75410d7487b3ce9e11d3bddc81f0f7e7c398990e --- src/Support/GretelServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Support/GretelServiceProvider.php b/src/Support/GretelServiceProvider.php index 25878d0..728a1d9 100755 --- a/src/Support/GretelServiceProvider.php +++ b/src/Support/GretelServiceProvider.php @@ -137,8 +137,8 @@ protected function bootThirdParty(): self $packages = $config->get('gretel.packages', []); if (Arr::get($packages, 'inertiajs/inertia-laravel') && class_exists(Inertia::class)) { - Inertia::share('breadcrumbs', static function() { - if ($route = request()->route()) { + Inertia::share('breadcrumbs', static function(Request $request) { + if ($route = $request->route()) { return $route->breadcrumbs()->jsonSerialize(); } return [];