ILPAV
ILPAV
FFilament
Created by ILPAV on 9/12/2023 in #❓┊help
Best way to format money or date with default string value
Components\TextEntry::make('final_cost')
->placeholder(__('N/A'))
->money('eur')
->label(__('Final Cost')),
Components\TextEntry::make('final_cost')
->placeholder(__('N/A'))
->money('eur')
->label(__('Final Cost')),
I guess using placeholder() instead of default() is also an option but the text displaying 'N/A' is obviously lighter
4 replies
FFilament
Created by ILPAV on 9/12/2023 in #❓┊help
Best way to format money or date with default string value
The same is true when using format(), the best work around I got is this:
Components\TextEntry::make('invoice_date')
->default(__('N/A'))
->formatStateUsing(fn (string | Carbon $state): string => $state == __('N/A')
? $state
: $state->format('d/m/Y'))
->label(__('Invoice Date')),
Components\TextEntry::make('invoice_date')
->default(__('N/A'))
->formatStateUsing(fn (string | Carbon $state): string => $state == __('N/A')
? $state
: $state->format('d/m/Y'))
->label(__('Invoice Date')),
4 replies
FFilament
Created by ILPAV on 9/11/2023 in #❓┊help
Using url() on BulkAction
It was because of this thanks
10 replies
FFilament
Created by ILPAV on 9/11/2023 in #❓┊help
Using url() on BulkAction
Thank you for the tip! I don't understand why but window.open doesn't work for me while alert yes:
->action(function (ListModels $livewire, Collection $records) {
$records->each(function (Model $record) use ($livewire) {
$livewire->js("alert('$record->link')"); // ok
$livewire->js("window.open('$record->link', '_blank')"); // does nothing
});
}),
->action(function (ListModels $livewire, Collection $records) {
$records->each(function (Model $record) use ($livewire) {
$livewire->js("alert('$record->link')"); // ok
$livewire->js("window.open('$record->link', '_blank')"); // does nothing
});
}),
10 replies
FFilament
Created by ILPAV on 9/11/2023 in #❓┊help
Using url() on BulkAction
Because all the files are in a different server, so I just want a way to open all the selected record links in a new tab
10 replies
FFilament
Created by ILPAV on 8/16/2023 in #❓┊help
Bug: Action button wrong background when disabled
8 replies
FFilament
Created by ILPAV on 8/16/2023 in #❓┊help
Bug: Action button wrong background when disabled
yeah probably, I think the solution is to prepand the active: directive before the :hover classes in the .blade.php inside this folder packages/support/resources/views/components/button
8 replies
FFilament
Created by ivanv on 8/16/2023 in #❓┊help
how can i change these texts to spanish?
For the rest of the missing translation I suggest taking them from this repository: https://github.com/Laravel-Lang/lang
7 replies
FFilament
Created by ivanv on 8/16/2023 in #❓┊help
how can i change these texts to spanish?
For the model name you can do something like this:
public static function getModelLabel(): string
{
return __('Product Category');
}

public static function getPluralModelLabel(): string
{
return __('Product Categories');
}
public static function getModelLabel(): string
{
return __('Product Category');
}

public static function getPluralModelLabel(): string
{
return __('Product Categories');
}
and insert the two strings inside the lang/es.json file
7 replies