SLy
SLy
FFilament
Created by SLy on 1/9/2024 in #❓┊help
How can I get current active form tab in a EditResource page?
I use the tabs layout for a form https://filamentphp.com/docs/3.x/forms/layout/tabs, I want to get current active tab so I can use it inside the getRedirectUrl method for the EditResource.
4 replies
FFilament
Created by SLy on 10/31/2023 in #❓┊help
Faded inactive action links based on Policy
Can I display default action links (View, Delete) as inactive, with a custom faded style if they are not authorized via policy? By default they are not displayed at all and I would like to keep the visual consistency for the Actions column.
7 replies
FFilament
Created by SLy on 10/15/2023 in #❓┊help
View title of a modal infolist
The offers are inside a relation manager having Customer as parent, when I click view on the offer I need to change the title of the modal that is opened for the infolist defined inside the Offers relation manager? I want to modify the default "View offer" label that is set by default when I open the infolist modal, I could not find any method in docs to do that.
6 replies
FFilament
Created by SLy on 10/14/2023 in #❓┊help
money() format on Infolist
How to remove trailling .00 from money() format on Infolist? Infolists\Components\TextEntry::make('price') ->label('Price') ->translateLabel() ->money(config('settings.currency')) ->color('secondary'), So I would like 250.00 to show as 250, but 250.12 should keep decimals.
4 replies
FFilament
Created by SLy on 10/13/2023 in #❓┊help
Spatie Translatable relation manager locale
use Translatable; #[Reactive] public ?string $activeLocale = null; Does not seem to inherit the locale of the Translatable resource page that the relation manager is being displayed on as state here https://filamentphp.com/plugins/filament-spatie-translatable#inheriting-the-relation-managers-active-locale-from-the-resource-page
5 replies
FFilament
Created by SLy on 10/5/2023 in #❓┊help
Translatable multiselect
I have a multiselect with spatie translatable, but when I change language, the values are not translated and I get console error: Uncaught (in promise) Could not find Livewire component in DOM tree in select.js Forms\Components\Select::make('transportTypes') ->relationship('transportTypes', 'name') ->getOptionLabelFromRecordUsing(fn (TransportType $transportType) => $transportType->name) ->preload() ->multiple() ->columnSpanFull(),
1 replies
FFilament
Created by SLy on 9/26/2023 in #❓┊help
Setting default value in input with createOptionForm
The ->default(fn (Get $get): ?int => $get('state_id')) in following code returns $get('state_id') as null, even though I select a value in state_id select, how can I prefill an input in the create createOptionForm modal with the value from another form field?
Forms\Components\Select::make('city_id')
->label('City')
->relationship('city', 'name')
->options(
fn (Get $get) => $get('state_id')
? City::whereStateId($get('state_id'))->pluck('name', 'id')
: []
)
->createOptionForm([
Forms\Components\TextInput::make('state_id')
->default(fn (Get $get): ?int => $get('state_id'))
->required(),
Forms\Components\TextInput::make('name')
->required(),
])
->preload()
->live()
->required(),
]),
Forms\Components\Select::make('city_id')
->label('City')
->relationship('city', 'name')
->options(
fn (Get $get) => $get('state_id')
? City::whereStateId($get('state_id'))->pluck('name', 'id')
: []
)
->createOptionForm([
Forms\Components\TextInput::make('state_id')
->default(fn (Get $get): ?int => $get('state_id'))
->required(),
Forms\Components\TextInput::make('name')
->required(),
])
->preload()
->live()
->required(),
]),
4 replies
FFilament
Created by SLy on 9/26/2023 in #❓┊help
Html validation with save on multiple tabs
I have 3 tabs in a resource, last tab has a repeater. If I add new item in repeater with required fields, then switch tabs and use the save button, form does not save because I have required html fields in previously opened tab and get: "An invalid form control with name='' is not focusable." in console.
6 replies
FFilament
Created by SLy on 9/25/2023 in #❓┊help
Duplicate queries in relation manager
No description
2 replies