- How do I install njxqlus/filament-relation-manager-component?
- Install it with composer require njxqlus/filament-relation-manager-component. Publishing the views is optional via php artisan vendor:publish --tag="filament-relation-manager-component-views". There are no migrations, no config file to edit, and no service provider setup required on your side.
- Which Filament and Laravel versions does this package support?
- Package majors track Filament majors: use the 1.x line with Filament v3 and the 2.x line with Filament v4 or v5. Laravel is supported up to 13.x. Pin the aligned pair explicitly in composer.json, because a Filament upgrade becomes a coordinated two-package upgrade.
- How do I embed a relation manager inside a form tab?
- Return the RelationManager component from your form schema and pass the manager class, for example RelationManager::make()->manager(VersionsRelationManager::class)->lazy(false) inside a Tab's schema. The component is accepted anywhere a schema component is accepted, so tabs, sections, modals, and slideovers all work. You reuse your existing RelationManager class rather than rewriting the table.
- Can I use relation managers in infolists as well as forms?
- Yes. The package ships Njxqlus\Filament\Components\Forms\RelationManager and Njxqlus\Filament\Components\Infolists\RelationManager. Use the Forms variant inside form() schemas and the Infolists variant inside infolist() schemas on detail or view pages. Both simply mount an existing manager class outside a resource relation tab.
- What does lazy loading do on an embedded relation manager?
- lazy() controls whether the embedded table is deferred and loaded in a follow-up request rather than with the parent page. The README examples use lazy(false) so tables render immediately inside tabs, which removes the extra round trip but adds the query cost to the parent page. Keep lazy loading enabled for heavy relations and measure before disabling it everywhere.
- Do Filament policies and tenancy scoping still apply when the manager renders outside a resource page?
- The component instantiates your existing RelationManager class, so table-level authorization and policy checks normally still run. However, the owner record and tenant context are resolved from the surrounding schema rather than a resource relation tab, which is one of the seams where behavior can differ. Verify canViewAny, canCreate, and tenancy scoping in your own panel before relying on it for privileged internal operations.
- How is this different from a relation manager on a resource page?
- A resource page relation manager is bound to that resource's page lifecycle, whereas this component lets the same class be mounted in any schema, including composite forms and detail infolists. It is a thin presentation-layer addition: it does not touch your models, policies, persistence, or Filament resource registration. The payoff is avoiding a hand-rolled table-plus-actions-plus-modal component for patterns like order line items or user roles.
- How do I test embedded relation managers?
- Write a Livewire feature test against the page or resource that renders the schema, then assert the embedded table shows the expected related records and that its actions respect authorization. Because the component wraps Filament's RelationManager, most assertions mirror those for a standard relation manager. Disabling lazy loading makes assertions simpler since records appear in the initial render.
- Is this package actively maintained and safe for production?
- It has a single primary maintainer, small adoption, and a maintenance pattern of reactive compatibility updates rather than new features. It is tightly coupled to Filament internals, and its changelog shows repeated fixes around owner record assignment, modal context, and infolist rendering, which are exactly the areas upstream refactors tend to break. Budget for re-validation on Filament minors and decide in advance whether you would vendor a fork as contingency.
- What are the alternatives if I don't want an external dependency?
- You can hand-roll a small Livewire component that renders a table with actions and a modal form, typically one to three engineer-days per occurrence, or keep related records on standard resource relation pages. If the embed-in-a-tab pattern only appears once or twice, the local component is often cheaper than taking on the dependency. Adopt the package when the pattern recurs across a Filament panel and the time saved outweighs the upgrade overhead.