From 8b7c711222cd417f9965ff753d303d798d8a4437 Mon Sep 17 00:00:00 2001 From: Stefan Sandu Date: Tue, 23 Sep 2025 10:26:55 +0300 Subject: [PATCH 1/2] Fix Laravel 12 compatibility: Handle SymfonySessionDecorator properly - Extract underlying session store from SymfonySessionDecorator using reflection - Prevents TypeError when setLaravelSession expects Session interface but receives decorator - Maintains backward compatibility with older Laravel versions --- src/NovaInlineRelationshipRequest.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/NovaInlineRelationshipRequest.php b/src/NovaInlineRelationshipRequest.php index b35ef9d..c969b3a 100644 --- a/src/NovaInlineRelationshipRequest.php +++ b/src/NovaInlineRelationshipRequest.php @@ -55,7 +55,18 @@ public static function createFrom(Request $from, $to = null) try { $session = $from->getSession(); - $request->setLaravelSession($session); + + // Laravel 12 compatibility fix: Handle SymfonySessionDecorator properly + if ($session instanceof \Illuminate\Session\SymfonySessionDecorator) { + // Extract the underlying session store from the decorator + $reflector = new \ReflectionClass($session); + $storeProperty = $reflector->getProperty('store'); + $storeProperty->setAccessible(true); + $actualSession = $storeProperty->getValue($session); + $request->setLaravelSession($actualSession); + } else { + $request->setLaravelSession($session); + } } catch (SessionNotFoundException $exception) { // do nothing } From a789921157250e3811ee9defbf05c00d9c68b71c Mon Sep 17 00:00:00 2001 From: Stefan Sandu Date: Tue, 23 Sep 2025 10:38:08 +0300 Subject: [PATCH 2/2] Fix Laravel 12 compatibility: Update Fluent::fill() method signature - Remove array type hint from fill() method to match parent class signature - Add runtime type checking for backward compatibility - Prevents Fatal Error: Declaration must be compatible with Illuminate\Support\Fluent::fill() --- src/Helpers/Fluent.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Helpers/Fluent.php b/src/Helpers/Fluent.php index 79d03d9..4b0ff7d 100644 --- a/src/Helpers/Fluent.php +++ b/src/Helpers/Fluent.php @@ -14,8 +14,13 @@ class Fluent extends \Illuminate\Support\Fluent * * @return $this */ - public function fill(array $attributes) + public function fill($attributes) { + // Ensure attributes is an array for Laravel 12 compatibility + if (!is_array($attributes)) { + $attributes = (array) $attributes; + } + foreach ($attributes as $key => $value) { $attribute = Str::replace('->', '.', $key);