Prodex
Prodex
FFilament
Created by Prodex on 7/2/2024 in #❓┊help
Checkboxlist set all true by default
Is there a way to set all options to true by default? Without the need to specify the options one by one.
1 replies
FFilament
Created by Prodex on 6/12/2024 in #❓┊help
First Action Modal doesn't close
I've implemented a delete action for the editOptionForm like so:
Forms\Components\Select::make('location_id')
->label('Location')
->relationship('location', 'name')
->required()
->searchable()
->preload()
->createOptionForm([
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
])
->editOptionForm([
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
])
->editOptionAction(fn (Forms\Components\Actions\Action $action, $record) => $action
->extraModalFooterActions([
DeleteAction::make()
->record($record)
->cancelParentActions(),
]),
),
Forms\Components\Select::make('location_id')
->label('Location')
->relationship('location', 'name')
->required()
->searchable()
->preload()
->createOptionForm([
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
])
->editOptionForm([
Forms\Components\TextInput::make('name')
->required()
->maxLength(255),
])
->editOptionAction(fn (Forms\Components\Actions\Action $action, $record) => $action
->extraModalFooterActions([
DeleteAction::make()
->record($record)
->cancelParentActions(),
]),
),
But the confirmation modal for the delete action is behind the edit modal, because the edit modal doesn't close. Even when using cancelParentActions. How can I make it, so the edit modal closes? Thank you!
1 replies
FFilament
Created by Prodex on 6/10/2024 in #❓┊help
Custom recordAction()
Hi, how can I trigger a custom action when a record is clicked? There is ->recordAction('myaction'); But this doesn't trigger it. Instead, the edit action is still triggered.
$table->actions([
Tables\Actions\Action::make('myaction')
->infolist([
Pages\ViewHardware::list(),
])
->slideOver()
->modalCancelAction(false)
->modalSubmitAction(false),
Tables\Actions\EditAction::make(),
])
$table->actions([
Tables\Actions\Action::make('myaction')
->infolist([
Pages\ViewHardware::list(),
])
->slideOver()
->modalCancelAction(false)
->modalSubmitAction(false),
Tables\Actions\EditAction::make(),
])
4 replies
FFilament
Created by Prodex on 5/17/2024 in #❓┊help
Cache Action (Modal) Response
Hi, is it possible to cache the response of filament table actions (modals) for a certain amount of time? Background: I've got a project that has a page which can experience a lot of traffic and I would like to keep the responses as tiny as possible. Because livewire makes additonal requests when a modal gets shown, I want to improve that as well.
2 replies
FFilament
Created by Prodex on 5/10/2024 in #❓┊help
How can I avoid N+1 problem in custom views?
As described in the docs I use a custom view for a table column and I'm using $getRecord() to access the eloquent model. This however makes an N+1 problem, because for every record displayed in the table the $getRecord() method retrieves the data from the database again. How can I avoid this? Thank you!
5 replies
FFilament
Created by Prodex on 4/26/2024 in #❓┊help
How to show a slideover infolist view when clicking a row in a resource table?
Can anyone provide code examples for something like that? Thanks!
7 replies
FFilament
Created by Prodex on 3/26/2024 in #❓┊help
Gantt Chart with Livewire / Filament / AlpineJS
Does anyone know a good package to build a gantt chart in filament, where the user can also interact with the items?
3 replies
FFilament
Created by Prodex on 2/28/2024 in #❓┊help
"Remember Me" with Socialite
When using Socialite, how should "remember me" work? If "remember" is set to true in Auth::login() the cookie gets set, but after the normal session times out, the middleware "AuthenticateSession" checks if a password hash is present. Because there's no password hash when using socialite, it always falls back to ->logout(). Anyone knows how to handle this correctly, without logging the user out?
1 replies
FFilament
Created by Prodex on 2/9/2024 in #❓┊help
Include JS Asset: "Identifier X has already been declared"
If I include JavaScript like the docs say, it doesn't bundle it through vite, so this doesn't work:
FilamentAsset::register([
Js::make('sentry', __DIR__ . '/../../resources/js/sentry.js'),
]);
FilamentAsset::register([
Js::make('sentry', __DIR__ . '/../../resources/js/sentry.js'),
]);
If I use the Vite facade it does load the correct file, but I get "Identifier X has already been declared", because vite doesn't know, that there are other assets as well.
FilamentAsset::register([
Js::make('sentry', Vite::asset('resources/js/sentry.js')),
]);
FilamentAsset::register([
Js::make('sentry', Vite::asset('resources/js/sentry.js')),
]);
How can I avoid this problem?
3 replies
FFilament
Created by Prodex on 2/9/2024 in #❓┊help
Collapsable column, but keeping the normal layout
Hi, is it somehow possible to have a column that is below the row which can be collapsed to add extra information, but keeping the "normal" layout (where each column has a title / label above)? If I use split() or stack(), it messes up my table and more importantly: the labels are gone. But in my case, I still need those. Thank you!
3 replies
FFilament
Created by Prodex on 1/17/2024 in #❓┊help
Calling Action Modal from parent livewire component
Hi, I'm having a "card" livewire component that's inside a loop from the parent component. The card component has a delete action with confirmation. The docs say the <x-filament-actions::modals /> needs to be in the same component as the action and that's true. However, if I do it like this, a modal gets rendered for each card, instead of just having one. Is there any better solution for this? Like calling the modal from the parent?
9 replies
FFilament
Created by Prodex on 1/11/2024 in #❓┊help
Sub Navigation in ListView for Custom Page
Hi, I want to display a sub navigation in the ListView for a custom page (which does not interact with any record). I have a subnavigation for my records setup already in my CustomerResource:
public static function getRecordSubNavigation(Page $page): array
{
return $page->generateNavigationItems([
Pages\Overview::class,
Pages\Projects::class,
]);
}

public static function getPages(): array
{
return [
'index' => Pages\ListCustomers::route('/'),
'overview' => Pages\Overview::route('/{record}'),
'projects' => Pages\Projects::route('/{record}/projects'),
];
}
public static function getRecordSubNavigation(Page $page): array
{
return $page->generateNavigationItems([
Pages\Overview::class,
Pages\Projects::class,
]);
}

public static function getPages(): array
{
return [
'index' => Pages\ListCustomers::route('/'),
'overview' => Pages\Overview::route('/{record}'),
'projects' => Pages\Projects::route('/{record}/projects'),
];
}
But how can I display a sub navigation on the ListCustomers Page for a custom Page? Thank you!
4 replies
FFilament
Created by Prodex on 1/8/2024 in #❓┊help
QueryBuilder Filter returns nothing
Hi, I have this simple RealtionshipContraint in my filter querybuilder. The items of the relation is displayed correctly in the select, but if one item is select with "is" operator, it doesn't return anything. To double check: It disabled / removed all other filters to avoid possible conflicts. But it still doesn't work:
QueryBuilder::make()
->constraints([
QueryBuilder\Constraints\TextConstraint::make('customer.name'),
QueryBuilder\Constraints\RelationshipConstraint::make('article')
->emptyable()
->selectable(QueryBuilder\Constraints\RelationshipConstraint\Operators\IsRelatedToOperator::make()
->titleAttribute('title'))]),
QueryBuilder::make()
->constraints([
QueryBuilder\Constraints\TextConstraint::make('customer.name'),
QueryBuilder\Constraints\RelationshipConstraint::make('article')
->emptyable()
->selectable(QueryBuilder\Constraints\RelationshipConstraint\Operators\IsRelatedToOperator::make()
->titleAttribute('title'))]),
"is empty" and "is not empty" works. The relationship itself works too, when it is used in other filters or fields. Can anyone help?
4 replies
FFilament
Created by Prodex on 12/22/2023 in #❓┊help
summarizer "all pages" custom record title attribute for
No description
3 replies
FFilament
Created by Prodex on 12/20/2023 in #❓┊help
Multiple columns of same attribute
Hi, how can I use the same attribute multiple times in a table? For example: I have a invoice table, which has "month" and "year" as column, but the data comes from the "date" attribute of the model, just with a different format. Thanks!
3 replies
FFilament
Created by Prodex on 11/30/2023 in #❓┊help
Sub-Navigation top position
Is it possible to get the top sub-navigation above the page title and breadcrumb, instead of having it below? It would make more sense for my use case (and maybe a lot of other use cases). Thank you!
5 replies
FFilament
Created by Prodex on 10/19/2023 in #❓┊help
Adding filter to custom widget
Hi, how can I implement a filter (start and end date) to a custom widget? Should I use a custom action for that or can I utilize filament filters for that? Thank you!
4 replies
FFilament
Created by Prodex on 10/4/2023 in #❓┊help
Using components outside filament
Hi, in V2 it was possible to use filament components outside filament, which could be done by also using the filament.base layout. But in V3, this base layout now needs $livewire to be passed through. How can I do this outside filament? I looked inside filament itself and didn't quite understand where $livewire even comes from, as it is used in the base layout, which is the first thing that gets loaded (I guess?) Thank you!
33 replies
FFilament
Created by Prodex on 9/27/2023 in #❓┊help
How to display loading indicator in widget
Hi, is it possible to render a loading indicator for widgets while they're still loading? I tried it like this:
<x-filament-widgets::widget>
<x-filament::section>
...
</x-filament::section>
<div wire:loading>
<x-filament::loading-indicator class="h-10 w-10 mx-auto" />
</div>
</x-filament-widgets::widget>
<x-filament-widgets::widget>
<x-filament::section>
...
</x-filament::section>
<div wire:loading>
<x-filament::loading-indicator class="h-10 w-10 mx-auto" />
</div>
</x-filament-widgets::widget>
5 replies
FFilament
Created by Prodex on 9/27/2023 in #❓┊help
Infolist with Array example?
Hi, I'm trying to use a repeatable entry with an array. But it doesn't seem to work. Is there an example on how this should look like? Thank you!
public function customerInfolist(Infolist $infolist): Infolist
{
return $infolist
->state([
2 => [
'expected' => 12457,
'booked' => 12457,
],
4 => [
'expected' => 12457,
'booked' => 12457,
],
])
->schema([
RepeatableEntry::make('customers')
->schema([
TextEntry::make('expected')
->label('Expected'),
TextEntry::make('booked')
->label('Booked'),
]),
]
);
}
public function customerInfolist(Infolist $infolist): Infolist
{
return $infolist
->state([
2 => [
'expected' => 12457,
'booked' => 12457,
],
4 => [
'expected' => 12457,
'booked' => 12457,
],
])
->schema([
RepeatableEntry::make('customers')
->schema([
TextEntry::make('expected')
->label('Expected'),
TextEntry::make('booked')
->label('Booked'),
]),
]
);
}
7 replies