ShawnVeltman
ShawnVeltman
FFilament
Created by ShawnVeltman on 10/21/2024 in #❓┊help
Modify the filter icon display on table filters?
Is it possible to update how the Filter Display looks in the Table (when adding to a Livewire component)? I've got a client asking for it to be a more prominent button with the word "Filters" next to it, but not sure how to go about it. Thanks for any help!
5 replies
FFilament
Created by ShawnVeltman on 8/21/2024 in #❓┊help
Any way to get screen size in a callback?
Hi all, Hoping somebody can help me with this one - I'm using a searchable select in one of my forms, and some users have complained that the keyboard doesn't work. It does, but it's a bit tricky, because you have to touch the part that says "Start typing to search...". I'd like to be able to keep that message for large size screens, but to have it say "click here and start typing to search" or something on md & smaller screens. My first thought was that I could use a callback in the searchPrompt method, but that suggests I'd need to be able to access the screen size as a variable in the callback... Any suggestions on how I might be able to get this to work?
2 replies
FFilament
Created by ShawnVeltman on 6/10/2024 in #❓┊help
Using data from multiple tables on a Bulk Action?
Hey all, hoping that Filament already has this built in, but couldn't find anything in the documentation. I know we can add multiple tables to a livewire component by having each table be its own component. Is there any way to access data from both tables in an action on the component? I have a use case where I want to be ablet to select multiple users, and multiple permissions, then attach those permissions to the users. Thanks for any help!
2 replies
FFilament
Created by ShawnVeltman on 2/23/2024 in #❓┊help
Sharing the Panel Builder scaffold with custom Livewire components?
Hi all, sorry if this is a really dumb question... Is it possible to share the scaffold/layout of the Panel Builder with a custom Livewire component?
e.g. If I have a Filament app from scratch using the panel builder, I get that lovely sidebar navigation & the dashboard screen, and any new resource gets the nav bar & the rest of the app scaffolding for free. If I create a custom Livewire component, I know I can add the navigation to that component to my navbar, but is there a way to say that the contents of that component should display in the same app scaffold that the Filament resource would (ie imagine the default dashboard page ... can I set my Livewire custom component to render inside where the dashboard would be?).
So far it seems like I have to create a separate app.blade.php file for the layouts for custom Livewire files, which makes hard to mix'n'match with the Filament resource panels. Sorry if I explained poorly, but hoping there's an easy way to do that which I've missed Thanks! Shawn
6 replies
FFilament
Created by ShawnVeltman on 2/4/2024 in #❓┊help
Anybody else temporarily losing Action capability after deploying?
Hi all, hoping somebody can help me out with this one, as it's a weird one for me. I'm finding on my production site that after I deploy, I (and my users) aren't able to trigger actions until we reload the page. Even if I push, then login, the first action I try doesn't do anything. Once I reload, it loads perfectly. I'm wondering if it's a view caching issue somehow? I've got "@php artisan filament:upgrade", in my post-autoload-dump, and I'm running $FORGE_PHP artisan optimize in my deploy script at the end (just before horizon terminate). I know I'm probably being stupid and have missed something obvious - hoping somebody here can point me in the right direction! Thanks!!
5 replies
FFilament
Created by ShawnVeltman on 1/22/2024 in #❓┊help
Pest Testing Repeater (extra value added in tests)
Hi all, I'm hoping somebody can help me understand where I'm going wrong. I've set up a repeater action
return CreateAction::make('create_content')
...
->form([
Section::make('Content')
->description('Add your content ')
->schema([
Repeater::make('articles')
->label('')
->addActionLabel('Add More Content')
->schema([
TextArea::make('body')
->label('')
->required(),
]),
]),
])->using(function (array $data, string $model): Model {
// I check my $data['articles'] here
});
return CreateAction::make('create_content')
...
->form([
Section::make('Content')
->description('Add your content ')
->schema([
Repeater::make('articles')
->label('')
->addActionLabel('Add More Content')
->schema([
TextArea::make('body')
->label('')
->required(),
]),
]),
])->using(function (array $data, string $model): Model {
// I check my $data['articles'] here
});
I'm trying to test it as such:
livewire(MyComponent::class)
->callTableAction('create_content', data: ['articles' => [
['body' => 'huh?'],
['body' => 'woah'],
['body' => 'cool'],
],
]);
livewire(MyComponent::class)
->callTableAction('create_content', data: ['articles' => [
['body' => 'huh?'],
['body' => 'woah'],
['body' => 'cool'],
],
]);
However, when I run the test in debug, the $data['articles'] variable has 4 entries - 1 null, and then the 3 I've specified in my test. Normally it wouldn't be a problem, I can just filter out the null value, but when I add in a ->required() to the textfield in the repeater, the test doesn't work (due to the null value, I'm assuming). Has anybody else experienced this, and can you point me to what I'm doing wrong? Thanks so much!
9 replies