Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Nova Inline Relationship allows you to manage (add/edit/update/delete/reorder) a

## Requirements

This package requires Laravel Nova 4.0.
This package requires Laravel Nova 5.0.

## Installation

Expand Down
7 changes: 6 additions & 1 deletion src/Helpers/Fluent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/NovaInlineRelationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function sortUsing(string $sortUsing): self
*
* @return void
*/
public function resolveForDisplay($resource, $attribute = null)
public function resolveForDisplay($resource, ?string $attribute = null): void
{
parent::resolveForDisplay($resource, $attribute);

Expand All @@ -110,7 +110,7 @@ public function resolveForDisplay($resource, $attribute = null)
*
* @return void
*/
public function resolve($resource, $attribute = null)
public function resolve($resource, ?string $attribute = null): void
{
parent::resolve($resource, $attribute);

Expand Down
13 changes: 12 additions & 1 deletion src/NovaInlineRelationshipRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down