Repository navigation
v1.3.0
A security fix, new features behind config switches, and a new default look for the menu. Update now if you use policies on your records. No breaking changes: every new key has a default in the code, so a published config from 1.2 keeps working.
Security
- Relation pages did not apply the record's
viewpolicy (1.0.0 to 1.2.1, GHSA-v3mh-w7qp-37gc). Filament checks it when the view page mounts, not incanAccess(), and relation pages only calledcanAccess(): a user deniedviewon a record, but allowedviewAny, could open its relation pages and see the related records and the header. Relation pages now run the same record check as the page they stand for (viewfor a view page,updatefor an edit page), also on every Livewire request.
Added
-
Links to relation manager tabs open the relation page (config
redirect_relation_tabs, defaultfalse):/customers/1?relation=billson the view or edit page redirects to/customers/1/bills, withwire:navigatein SPA mode. Tabs without a relation page, or that the record cannot see, stay where they are. Per page:shouldRedirectRelationNavigatorTabs()andgetRelationNavigatorTabRedirectUrl(). -
Deferred badges:
menu.badgesalso takes'lazy'. The page then renders without the badge queries, and the menu loads the badges when it opens (one request, a spinner meanwhile). New page methodshasDeferredRelationNavigatorBadges()andgetRelationNavigatorBadges(), and$hasDeferredBadgesfor preset views. If you published the package views, updatemenu/partials/list.blade.phpbefore turning it on, or the menu shows no badges. -
Previous and next record buttons before the header actions of the pages with the menu (config
record_navigation, defaultfalse). They open the neighbour by key on the same page (view, edit, a relation page), or on its first page in the menu when it cannot open that one, and are disabled at the ends. They use the resource's own query, so tenancy and your scopes apply. Per page:hasRelationNavigatorRecordNavigation(),getRelationNavigatorRecordNavigationQuery(),getRelationNavigatorRecordNeighbours(). Nested resources are not supported yet: they show no buttons. -
"Open as page" link above the table of every relation manager that has its own page, on the view and edit pages (config
relation_manager_link, defaulttrue). It links to the relation group's page for a manager inside a group, and tells apart two entries of the same manager (PostsRelationManager::make([...])) by their properties.RelationNavigator::getRelationManagerPageUrl()returns the same URL for your own buttons. -
RelationPage::canAccessRecord()andRelationNavigator::canAccessRecordPage(): the record check of the view and edit pages.
Fixed
- The menu lists the view and edit pages only when the user can open them for the record (
viewandupdatepolicies): a user who cannot edit a record no longer sees an Edit item that ends in a 403.
Changed
- The default menu is now the
githubpreset with the search field (menu.preset=github,menu.searchable=true): it is the one with the most features. Apps that published the config keep what they set. To keep the menu of 1.2 and earlier, set'preset' => 'simple'and'searchable' => falseinconfig/filament-relation-navigator.php, or overridegetRelationNavigatorPreset()andisRelationNavigatorSearchable()on the page.
Internal
- Tests for each feature, tenancy, nested resources and record policies included, and a browser test for the deferred badges. README with a GIF and new screenshots.