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); 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 }