ericlbarnes
ericlbarnes
FFilament
Created by ericlbarnes on 8/31/2023 in #❓┊help
"anonymous" actions to a form but only on edit?
I have a form for creating/editing articles. I want to add a "preview" button that just loads the url..
Action::make('preview')
->icon('heroicon-o-arrow-top-right-on-square')
->color('gray')
->url(fn (Set $set, $state): string => $state['slug'] ? route('article.details', ['slug' => $state['slug']]) : '')
Action::make('preview')
->icon('heroicon-o-arrow-top-right-on-square')
->color('gray')
->url(fn (Set $set, $state): string => $state['slug'] ? route('article.details', ['slug' => $state['slug']]) : '')
Is it possible to tell the action to not display if it's on the create page? Or when $state['slug'] is empty?
7 replies
FFilament
Created by ericlbarnes on 8/23/2023 in #❓┊help
Change the option title in a SelectFilter relationship
I have a simple table filter like this:
SelectFilter::make('group')
->relationship('group', 'name'),
SelectFilter::make('group')
->relationship('group', 'name'),
https://filamentphp.com/docs/3.x/tables/filters#relationship-select-filters I don't see it outlined in the docs, but is it possible to change the way the options are generated? For example, it shows the name, but I'd like it to be:
<option value="">{{ $id }} - {{ $name }}</option>
<option value="">{{ $id }} - {{ $name }}</option>
5 replies
FFilament
Created by ericlbarnes on 3/15/2023 in #❓┊help
Get the underlying query after filtering a table
I imagine this is a unique request but is it possible to get the final DB query after you've sorted and filtered a table? What I'm trying to accomplish (there might be better ways) is to take a table and allow a user to filter down and use the filtered results to send an email to all the ones left in the table. The problem comes in where a filtered table could, in theory, still contain thousands of records so I was thinking I could just grab the underlying query and do things on my own, where I'm not sure bulk actions would work with that much data and that many pages of data.
4 replies