Skip to content

Conversation

@sanduestefan
Copy link

Fix Laravel 12 Compatibility Issues

This PR resolves two critical compatibility issues preventing the package from working with Laravel 12.

Issues Fixed

1. SymfonySessionDecorator TypeError

  • Error: TypeError: Argument #1 ($store) must be of type Illuminate\Contracts\Session\Session, Illuminate\Session\SymfonySessionDecorator given
  • Solution: Extract underlying session store from decorator using reflection
  • File: src/NovaInlineRelationshipRequest.php

2. Fluent Method Signature Incompatibility

  • Error: Fatal error: Declaration must be compatible with Illuminate\Support\Fluent::fill($attributes)
  • Solution: Remove array type hint and add runtime type checking
  • File: src/Helpers/Fluent.php

Testing

✅ Tested with Laravel 12.28.1 and Nova 4.0
✅ Inline relationship functionality works as expected
✅ Maintains backward compatibility with older Laravel versions

Impact

Allows the package to work seamlessly with Laravel 12 while preserving all existing functionality.

- 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
- 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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant