dissto
dissto
FFilament
Created by prowler on 6/30/2024 in #❓┊help
Passing closure in viewData
I think you can just access the record directly in the view without the need to pass it down?
@dd($getRecord())
@dd($getRecord())
🤔
4 replies
FFilament
Created by Rinkesh on 6/28/2024 in #❓┊help
How to get list of all resources name?
Try
Filament::getResources()
Filament::getResources()
https://github.com/filamentphp/filament/blob/3.x/packages%2Fpanels%2Fsrc%2FFilamentManager.php#L340
3 replies
FFilament
Created by Blackpig on 6/21/2024 in #❓┊help
Add an option to Checkboxlist via an Action
Im not sure that ->helperText() accepts an action by default. But maybe you could use ->hintAction() instead? 🤔
6 replies
FFilament
Created by shabxs on 6/22/2024 in #❓┊help
Livewire pest plugin code replication
Probably as second param to livewire() ? 🤔 Something like:
livewire(SearchPosts::class, ['search' => 'hair'])
->assertSee('Testing the first')
livewire(SearchPosts::class, ['search' => 'hair'])
->assertSee('Testing the first')
Or are you trying to have a test for the search ?
5 replies
FFilament
Created by toeknee on 6/20/2024 in #❓┊help
RelationshipManager Table Ordering
You can inject the query in ->defaultSort() though 🤔
->defaultSort(function (Builder $query) {
//
})
->defaultSort(function (Builder $query) {
//
})
7 replies
FFilament
Created by urbycoz on 6/19/2024 in #❓┊help
Adding a "show more/less" toggle to long description in infolist
4 replies
FFilament
Created by Sydd on 6/19/2024 in #❓┊help
global search sort results
You probably need to order the query as opposed to the collection? 🤔
public static function getGlobalSearchEloquentQuery(): Builder
{
return parent::getGlobalSearchEloquentQuery()->orderBy('date_at', 'desc');
}
public static function getGlobalSearchEloquentQuery(): Builder
{
return parent::getGlobalSearchEloquentQuery()->orderBy('date_at', 'desc');
}
See: https://filamentphp.com/docs/3.x/panels/resources/global-search#adding-extra-details-to-global-search-results
5 replies
FFilament
Created by lairg.25 on 6/17/2024 in #❓┊help
Loading indicators for tables
There will be a table loading skeleton soon. I suppose in the meantime the spa() mode is the closes to what you want. Unless you are willing to add your own logic 🤔
5 replies
FFilament
Created by Koda on 6/13/2024 in #❓┊help
TextInput with an autocomplete function
Why not?
TextInput::make('manufacturer')
->datalist(function(){
return Api::all(); // something like that ... or however you retreive your data?!
})
TextInput::make('manufacturer')
->datalist(function(){
return Api::all(); // something like that ... or however you retreive your data?!
})
Or what do you mean?
8 replies
FFilament
Created by adysone on 6/13/2024 in #❓┊help
Update viewfield state with placeholder addition values
You probably want to work with the state or the record and do your calculations! 🤔
6 replies
FFilament
Created by Koda on 6/13/2024 in #❓┊help
TextInput with an autocomplete function
8 replies
FFilament
Created by nowak on 6/11/2024 in #❓┊help
When using the Tabs layout in custom page, how can I make an action react to tab changes?
Curious, can you not just use $this->activeTab ?
12 replies
FFilament
Created by TK on 6/10/2024 in #❓┊help
How to route to a page with a given filter?
Url is just a link...the action is an actual redirect. But you can use the same with an action..i was just using url in this case 😋
20 replies
FFilament
Created by TK on 6/10/2024 in #❓┊help
How to route to a page with a given filter?
->url(function ($record) {

$query = http_build_query([
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
]);

$query = urldecode($query);

$baseUrl = ListOtherResourceFilament::getUrl();

return $baseUrl.'?'.$query;
})
->url(function ($record) {

$query = http_build_query([
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
]);

$query = urldecode($query);

$baseUrl = ListOtherResourceFilament::getUrl();

return $baseUrl.'?'.$query;
})
Well maybe constructing the url yourself. Not sure if there is an easier way. Or even a way to not encode the route parameters, as this seems to be causing the issue. 🤔
20 replies
FFilament
Created by TK on 6/10/2024 in #❓┊help
How to route to a page with a given filter?
I see what you mean now
20 replies
FFilament
Created by TK on 6/10/2024 in #❓┊help
How to route to a page with a given filter?
Well the url is encoded, thats to be expected?! Can you use a url for testing?
Action::make()
->url(fn () => ListOtherResourceFilament::getUrl(parameters: [
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
])
))
Action::make()
->url(fn () => ListOtherResourceFilament::getUrl(parameters: [
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
])
))
20 replies
FFilament
Created by TK on 6/10/2024 in #❓┊help
How to route to a page with a given filter?
Well as I see it you have 2 simple options. Either pass the name "index" as first paremeter or use named arguments:
return $table
->...
->actions([
ActionGroup::make([
Action::make('...')
->...
->action(
fn($record) => redirect()->to(
ListOtherResourceFilament::getUrl('index', [
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
])
)
)
,
]),
]);
return $table
->...
->actions([
ActionGroup::make([
Action::make('...')
->...
->action(
fn($record) => redirect()->to(
ListOtherResourceFilament::getUrl('index', [
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
])
)
)
,
]),
]);
Or
return $table
->...
->actions([
ActionGroup::make([
Action::make('...')
->...
->action(
fn($record) => redirect()->to(
ListOtherResourceFilament::getUrl(parameters: [
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
])
)
)
,
]),
]);
return $table
->...
->actions([
ActionGroup::make([
Action::make('...')
->...
->action(
fn($record) => redirect()->to(
ListOtherResourceFilament::getUrl(parameters: [
'tableFilters' => [
'unit' => [
'reservable' => [
'code' => $record->id
],
],
],
])
)
)
,
]),
]);
🤔
20 replies
FFilament
Created by FilamentDEV on 6/9/2024 in #❓┊help
How to change a label for a field, in view page?
I guess you could do something like that:
Select::make('company_registration_country')
->live()
->label(function (Get $get, Select $component, $state){
// if you simply want the country code
return 'Company Registration ' . $get('company_registration_country');

// or you probably want the actual name of the country as opposed to the country code
return 'Company Registration ' . ($component->getOptions()[$state] ?? null);
})
->options([
'FR' => 'France',
'CZ' => 'Czech Republic',
]),
Select::make('company_registration_country')
->live()
->label(function (Get $get, Select $component, $state){
// if you simply want the country code
return 'Company Registration ' . $get('company_registration_country');

// or you probably want the actual name of the country as opposed to the country code
return 'Company Registration ' . ($component->getOptions()[$state] ?? null);
})
->options([
'FR' => 'France',
'CZ' => 'Czech Republic',
]),
🤔
5 replies
FFilament
Created by Vladimir on 6/9/2024 in #❓┊help
afterStateUpdated results in unpredictable result
Another great candiate for onBlur: true I don't see any value that the slug must be converted instantly. Just do it whenever you blur the title field? 🤔 This avoids your current problem and is the better UX imho anyway 😊
21 replies
FFilament
Created by Aethyrion on 6/8/2024 in #❓┊help
Sum summarizer not respecting MoneyCast in table output
There is also a divideBy argument for money() that allows you to divide the original value by a number before formatting it. This could be useful if your database stores the price in cents, for example:
See: https://filamentphp.com/docs/3.x/tables/summaries#currency-formatting
4 replies