BuddhaNature
BuddhaNature
FFilament
Created by BuddhaNature on 6/27/2024 in #❓┊help
When using EditAction in an ActionGroup, how can the icon be removed?
No description
10 replies
FFilament
Created by BuddhaNature on 5/29/2024 in #❓┊help
How can the resource query be modified on an Infolist page?
Hi, When loading a resource, the standard select uses *. On a table page, I can use modifyQueryUsing() to modify the resource to suit the table's needs, but I don't see a way to do that with a View page that doesn't have a modifyQueryUsing() method either on the Page or the Infolist.
6 replies
FFilament
Created by BuddhaNature on 5/10/2024 in #❓┊help
nestedRecursiveRules
How can I add custom messages to nestedRecursiveRules() in a tag input? In the example below, I get the following error: "The mountedActionsData.0.tags.7 field must not be greater than 25 characters."
TagsInput::make('tags')
->rules(['max:10'])
->validationMessages([
'max' => 'You can only add up to :max tags.',
])
->nestedRecursiveRules([
'min:3',
'max:25',
]);
TagsInput::make('tags')
->rules(['max:10'])
->validationMessages([
'max' => 'You can only add up to :max tags.',
])
->nestedRecursiveRules([
'min:3',
'max:25',
]);
10 replies
FFilament
Created by BuddhaNature on 4/4/2024 in #❓┊help
Show which tabs have form errors when a form is submitted
I have an "Infolist" page with entries organized in tabs. To keep the UI consistent and a pleasant experience for the user, the edit action displays all of the form elements in the same tab structure in the form. The problem I am facing is that when the form is submitted and re-rendered with validation errors, it's not clear where the validation errors are because the page is reset back to the first tab on submit. The end user does not know where the validation error is and has to click on each individual tab. Has anyone come up with a solution to a problem like this? Is there a way to either highlight a tab with errors or add a badge with a count of errors?
1 replies
FFilament
Created by BuddhaNature on 3/4/2024 in #❓┊help
How can I force a modal to a view when a view page exists.
Hi, I have an action that links to a view page, but I'd also like to have a link to a preview page of that view page as a modal. I am using the following code:
ActionGroup::make([
ViewAction::make()
->slideOver()
->modalHeading('Lorem ipsum dolor sit amet, consectetur adipiscing elit.')
->modalDescription('Aenean mollis elit eget ullamcorper venenatis.')
->label('Preview')
->icon(''),
ViewAction::make()
->label('Full View')
->icon(''),
]),
ActionGroup::make([
ViewAction::make()
->slideOver()
->modalHeading('Lorem ipsum dolor sit amet, consectetur adipiscing elit.')
->modalDescription('Aenean mollis elit eget ullamcorper venenatis.')
->label('Preview')
->icon(''),
ViewAction::make()
->label('Full View')
->icon(''),
]),
The second View action works perfectly and links to the view page. But the first View action does not act as a modal and instead links directly to the view page. How can I get the preview link to work as a modal?
6 replies
FFilament
Created by BuddhaNature on 2/5/2024 in #❓┊help
How can I add a locale as a url parameter on a panel?
I tried adding a locale parameter to my code so that instead of this:
public function panel(Panel $panel): Panel
{
return $panel
->id('books')
//
->path('books/');
}
public function panel(Panel $panel): Panel
{
return $panel
->id('books')
//
->path('books/');
}
I have this:
public function panel(Panel $panel): Panel
{
return $panel
->id('books')
//
->path('books/{locale}');
}
public function panel(Panel $panel): Panel
{
return $panel
->id('books')
//
->path('books/{locale}');
}
But that did not work.
9 replies
FFilament
Created by BuddhaNature on 2/2/2024 in #❓┊help
How can I remove the resource name from all action buttons such as "create"?
How can I remove the resource name from all action buttons such as "create"? For example, If I have a "Book" resource and a "Movie" resource, I end up with "Create Book" and "Create movie" buttons assuming the action is "Create." I'd like the button to omit the resource name without having to explicitly use a label() method because I don't want to lose localization options. The end result I'm looking for is to have a simple "Create" button that is localized without having to localize the resource name/label.
1 replies
FFilament
Created by BuddhaNature on 1/18/2024 in #❓┊help
How can I add an asterisk next to a required field when using ->rules(['required'])?
No description
4 replies
FFilament
Created by BuddhaNature on 1/15/2024 in #❓┊help
unsavedChangesAlerts() does not work and generates an error
No description
6 replies
FFilament
Created by BuddhaNature on 1/10/2024 in #❓┊help
How can I limit the query on just one page using getEloquentQuery()
Hi. I don't need all the columns of a resource for my list page. How can I create a select() that only applies to the list page?
9 replies
FFilament
Created by BuddhaNature on 1/10/2024 in #❓┊help
Using $navigationGroup with getRecordSubNavigation()
Is there a way to group sub-navigation presented with getRecordSubNavigation() using something similar to $navigationGroup? I tried $navigationGroup and it didn't work.
1 replies
FFilament
Created by BuddhaNature on 11/20/2023 in #❓┊help
Preventing the display of a related resource on a view or edit page.
How can I prevent the display of a resource on either a view or an edit page?
6 replies
FFilament
Created by BuddhaNature on 11/20/2023 in #❓┊help
What is the performance difference between `->resources()` and `->discoverResources()`?
How much more performance is gained by using ->resources() instead of discovery via ->discoverResources().
2 replies
FFilament
Created by BuddhaNature on 11/7/2023 in #❓┊help
Customizing the user experience of the empty state on tables based on existing conditions.
I have a question about the user experience when using tables. Let's assume that there is an empty table because there are no records created and the empty state has been configured with ->emptyStateActions(), ->emptyStateDescription(), ->emptyStateHeading(), and ->emptyStateIcon(). In this scenario, we can write copy to clearly instruct the user on what to do to add a record. But in a different scenario, where there are 100 records, and none are trashed, if the user filters to show only trashed records, they would get the same message as above. Is there a way to do something like this:
->emptyStateHeading(function () {
if (($this->isFilteredView())) {
return 'You currently have a filter active that may affect what you see.';
}

return 'Create a new record.';
})
->emptyStateHeading(function () {
if (($this->isFilteredView())) {
return 'You currently have a filter active that may affect what you see.';
}

return 'Create a new record.';
})
I know isFilteredView() is not real, but is there a way to tell if the filtering system is engaged or not? In my use case someone was tinkering and activated a filter for "favorites" and thought there were no records because she got the empty state. She reentered data that was already available. I'd like to be able to clearly articulate to the end user what they are seeing based on their actions.
4 replies
FFilament
Created by BuddhaNature on 11/2/2023 in #❓┊help
How can I eliminate HTML comments on all pages?
How can I remove all Filament comments from the HTML source? For example:
<!--[if ENDBLOCK]><![endif]-->
<!--[if ENDBLOCK]><![endif]-->
4 replies
FFilament
Created by BuddhaNature on 11/2/2023 in #❓┊help
How to render HTML in a Table's empty state description, e.g. emptyStateDescription()
No description
5 replies
FFilament
Created by BuddhaNature on 10/30/2023 in #❓┊help
Updating a date with a Table Toggle.
Hi, I have a dateTime filed called archived_on. I'd like to edit this column using a toggle field in a table. Specifically, when the toggle is switched to "off", I want the date field to be set to null, when the toggle is switched to "on", I want the field to be set to now(). How can I go about this?
5 replies
FFilament
Created by BuddhaNature on 10/30/2023 in #❓┊help
How to show a table with only records that belong to the authenticated user?
Hi, I'm building a sample Filament site to practice and learn. I'm stuck on how I can make a resource only show records that belong to the authenticated user. For example, in my products table, I have a user_id column. I only want to show records that match user_id with auth()->user()->id in my Filament table.
10 replies
FFilament
Created by BuddhaNature on 10/25/2023 in #❓┊help
Should I require Livewire 3 manually before I require Filament in my project?
Hi, I've been playing with Filament, and I see that if I create a new Laravel project and immediately include Filament, Livewire is brought in as a dependency. However, I see many people bringing in Livewire 3 manually first and then bringing in Filament. I'm wondering why and if this is a best practice.
3 replies