TK
TK
FFilament
Created by TK on 10/4/2024 in #❓┊help
Change order of top bar icons
How do I change the order of the icons in the top bar? To be specific about my case, I have the following order: search bar :: language switcher (plugin) :: database notifications icon :: default menu icon I want: search bar :: database notifications icon :: language switcher (plugin) :: default menu icon It shouldn't be this hard to define an order per item right?
4 replies
FFilament
Created by TK on 6/25/2024 in #❓┊help
Disable search on select multiple
How to disable search on a select multiple? This does not work:
return $select
->multiple()
->options($groupedOptions)
->preload()
->searchable(false);
return $select
->multiple()
->options($groupedOptions)
->preload()
->searchable(false);
2 replies
FFilament
Created by TK on 6/25/2024 in #❓┊help
How to replace the reorder indicator?
When enabling reordering, the text Drag and drop the records into order. is shown. This comes from __('filament-tables::table.reorder_indicator'). Does anyone know how I can replace this text? I would like to state something like Drag and drop the :model into order..
7 replies
FFilament
Created by TK on 6/10/2024 in #❓┊help
How to route to a page with a given filter?
Currently I have a resource with a relation resource. Those relation resource records should get a url to another page with there given property as a filter. So, in my ExampleRelationManager I have this:
return $table
->...
->actions([
ActionGroup::make([
Action::make('...')
->...
->action(
fn($record) => redirect()->to(
ListOtherResourceFilament::getUrl([
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
])
)
)
,
]),
]);
return $table
->...
->actions([
ActionGroup::make([
Action::make('...')
->...
->action(
fn($record) => redirect()->to(
ListOtherResourceFilament::getUrl([
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
])
)
)
,
]),
]);
This is not working. I assume there is a correct way to give filters to the ::getUrl() method, just like given a route parameter. For the record, the URL to end up with, should be: https://example.local/...?tableFilters[unit][reservable][code]=UN100000 Help?
20 replies
FFilament
Created by TK on 6/7/2024 in #❓┊help
How to use slideover() on mobile only?
I want to use slideOver() on actions (for example ViewAction) when clicking "view". And on desktop, I do NOT want to use the slideover but the normal modal popup. Does anyone know how to do this?
2 replies
FFilament
Created by TK on 6/3/2024 in #❓┊help
getUploadedFileNameForStorageUsing() on FileUpload::configureUsing() does not work :S
Using ->getUploadedFileNameForStorageUsing() when defining defaults for file uploads, does not work. So, doing this inside the AppServiceProvider does not work:
namespace App\Providers;

FileUpload::configureUsing(function (FileUpload $component): void {
$component->getUploadedFileNameForStorageUsing(
function (TemporaryUploadedFile $file): string {
...
},
);
});
namespace App\Providers;

FileUpload::configureUsing(function (FileUpload $component): void {
$component->getUploadedFileNameForStorageUsing(
function (TemporaryUploadedFile $file): string {
...
},
);
});
Not sure why this specifically is for ->getUploadedFileNameForStorageUsing(). I think it would be nice defining a default way files are stored globally, instead of doing this on all FileUpload::make() everywhere. Note, using the exact same function on Fileupload::make()->getUploadedFileNameForStorageUsing(), does work! Anyone got an idea? Is this a bug?
3 replies
FFilament
Created by TK on 5/17/2024 in #❓┊help
Change color of reveal password icon
How to change the color of the 'reveal password' icon? Simply calling ->suffixIconColor(...) after ->revealable() does not work. Not sure if this is a bug or not. Anyone got an idea on how to fix this?
34 replies
FFilament
Created by TK on 5/16/2024 in #❓┊help
How to change the color of the sort icon when active?
I have a table with multiple columns and multiple columns is sortable (asc, desc). All arrow icons beside the column header texts are grey. Whenever I sort a column, the icon get a little big darker "indicating" it is active. Since this color change is so minimal, I want to set the color of that icon when it's active. Anyone got an idea?
6 replies
FFilament
Created by TK on 5/16/2024 in #❓┊help
Setting navigation group as collapsed by default
How do I set a navigation group, which is created from the resource AND used by multiple resources, to be collapsed by default?
class RelationFilamentResource extends Resource
{
...

public static function getNavigationLabel(): string
{
return 'Relations';
}

public static function getNavigationGroup(): ?string
{
return 'Reservations'; // <--- same navigation group that should be collapsed by default!
}

...
class RelationFilamentResource extends Resource
{
...

public static function getNavigationLabel(): string
{
return 'Relations';
}

public static function getNavigationGroup(): ?string
{
return 'Reservations'; // <--- same navigation group that should be collapsed by default!
}

...
class PaymentFilamentResource extends Resource
{
...

public static function getNavigationLabel(): string
{
return 'Payments';
}

public static function getNavigationGroup(): ?string
{
return 'Reservations'; // <--- same navigation group that should be collapsed by default!
}

...
class PaymentFilamentResource extends Resource
{
...

public static function getNavigationLabel(): string
{
return 'Payments';
}

public static function getNavigationGroup(): ?string
{
return 'Reservations'; // <--- same navigation group that should be collapsed by default!
}

...
13 replies
FFilament
Created by TK on 5/10/2024 in #❓┊help
How to prefill a TextInput on the create resource form?
So when I want to create a new user for example, I automatically want a TextInput to be filled with a certain value. And this should be visible to the users and not editable. I got everything, except for the part on how to fill that input text field. Anyone?
6 replies
FFilament
Created by TK on 5/10/2024 in #❓┊help
Tooltip for suffixIcon possible?
Currently I'm creating an TextInput field with a suffix icon. Is it possible to give this suffix icon a tooltip?
TextInput::make('key')
->label('Key')
->suffixIcon('heroicon-o-clipboard-document')
->suffixIconColor(FilamentColor::getColors()['danger'])
...
TextInput::make('key')
->label('Key')
->suffixIcon('heroicon-o-clipboard-document')
->suffixIconColor(FilamentColor::getColors()['danger'])
...
21 replies
FFilament
Created by TK on 5/10/2024 in #❓┊help
Adjust form fields shown when user views resource
Filament has a default built-in ViewAction(), which you can add to an ActionGroup() in your table() function, so in the overview you can click on "view record". By default, all the fields are disabled and shown in a modal. My question: how do I hide certain inputs in this modal? Context: On the edit page, people can edit the password. But when the record is shown in "view mode", no need to show those password fields. I hope you guys can help me out.
1 replies