Important: You will need to set up a policy to limit access to the User Views Resource. Without a policy, any user will be able to rename, update, or delete any User View. See the policy section for more information.
Easily toggling a views public, or global setting
The icons in the rows are actionable and can be clicked to quickly toggle the setting.User Views Resource configurations
Advanced Tables offers multiple ways to customize the User Views Resource. Unless specified otherwise, these options can be configured directly on theAdvancedTablesPlugin object inside your PanelProvider.
Disabling the User Views Resource
Advanced Tables enables the User Views Resource by default. If you are not using User Views, you may disable this by passingfalse to the resourceEnabled() method:
Customizing the labels
You may customize themodel label, plural model label, and navigation label in the language file.
Customizing the navigation icon
You may customize the navigation icon by passing aheroicon to the resourceNavigationIcon() method:
Customizing the navigation group
You may customize the navigation group by passing astring to the resourceNavigationGroup() method:
Customizing the navigation sort order
You may customize the navigation sort order by passing anint to the resourceNavigationSort() method:
Disabling the Navigation Badge
By default, Advanced Tables shows a badge in the navigation of the number of unapproved views. You may disable this by passingfalse to the resourceNavigationBadge() method:
Disabling loading all users in the user select filter
By default, when filtering users in the User Views Resource all users will be loaded. This is fine for smaller applications with a handful of users, but if you application has hundreds or thousands of users, you may disable loading all users by passingfalse to the resourceLoadAllUsers method:
Using multiple panels
When using multiple panels the User Views Resource by default will only show the User Views associated with the current panel’s resources. However, since theUserViewResource::class is part of the plugin, if you create views on the User View Resource then those views will appear in every panel’s User Views Resource. Sometimes, this maybe desired. For example, if you create an “Approved” view on the User View Resource, you may want that view to appear in the User Views Resource of every panel.
However, if you prefer each User Views Resource to be independent, you can follow the steps below:
Note: This will only affect future views created for the User Views Resource. It will not update views you previously created for your User Views Resource.
-
Copy
archilex/filament-filter-sets/src/Resources/UserViewResource.phpandarchilex/filament-filter-sets/src/Resources/UserViewResource/Pages/ManageUserViews.phpfiles to your panels directory:Note: While you can extend the plugin’s UserViewResource for each panel, it is also possible to use the plugin’s UserViewResource for your main panel and only extend the resource for your secondary panels.
-
Extend UserViewResource.php:
-
Update ManageUserViews.php
Showing user views from multiple panels
As mentioned, by default the User Views Resource will only show the User Views that are associated to that panel. However, if you would like to include views from other panels you can do that by passing an array of panel ids to the->resourcePanels() method.
Note: The open action will only be displayed for the current panel’s user views.