dyo
dyo
FFilament
Created by dyo on 6/27/2024 in #❓┊help
formatStateUsing method in TextColumn is not working at the custom page
Why my formatStateUsing method in TextColumn is not working at the custom page. I try debugging the problem with simple formatState like
TextColumn::make('name')
->formatStateUsing(fn ($record) => $record->id)
TextColumn::make('name')
->formatStateUsing(fn ($record) => $record->id)
But it returns nothing.
2 replies
FFilament
Created by dyo on 6/27/2024 in #❓┊help
resetTable with table loading animation
How can I have a loading table animation when resetTable is triggered?
5 replies
FFilament
Created by dyo on 6/26/2024 in #❓┊help
Changing navigation color text.
How can I change the color of navigation item text to black?
10 replies
FFilament
Created by dyo on 6/24/2024 in #❓┊help
previous or next button for month in datepicker
How can I have a previous or next button for month navigation in filament datepicker?
5 replies
FFilament
Created by dyo on 6/22/2024 in #❓┊help
Make placeholder text black
How can I make my input placeholder text to be black?
7 replies
FFilament
Created by dyo on 6/13/2024 in #❓┊help
Problem in accessing widget current record
https://filamentphp.com/docs/3.x/panels/resources/widgets#accessing-the-current-record-in-the-widget Can someone help me explain more about accessing widget current record? My widget class:
public ?Model $record = null;

protected static ?string $pollingInterval = '30s';

public function mount($record)
{
$this->record = $record;
}

protected function getCards(): array
{
dd($this->record);
$total = max(Konfirmasi::where('campaigns_id', $this->record)->count(), 1);

$pending = Campaign::find($this->record)
->konfirmasi()->pending()->count();

return [
Stat::make('Completed', $sukses)
->color('success')
->description('Rp ' . number_format(Campaign::find($this->record)
->konfirmasi()->sukses()->sum('dana'))
. ' (' . number_format($sukses / $total * 100, 1) . '%)')
->descriptionIcon('heroicon-m-check-badge'),
public ?Model $record = null;

protected static ?string $pollingInterval = '30s';

public function mount($record)
{
$this->record = $record;
}

protected function getCards(): array
{
dd($this->record);
$total = max(Konfirmasi::where('campaigns_id', $this->record)->count(), 1);

$pending = Campaign::find($this->record)
->konfirmasi()->pending()->count();

return [
Stat::make('Completed', $sukses)
->color('success')
->description('Rp ' . number_format(Campaign::find($this->record)
->konfirmasi()->sukses()->sum('dana'))
. ' (' . number_format($sukses / $total * 100, 1) . '%)')
->descriptionIcon('heroicon-m-check-badge'),
I get error Unable to resolve dependency [Parameter #0 [ <required> $record ]] in class Widget What should I do?
8 replies
FFilament
Created by dyo on 6/12/2024 in #❓┊help
About stripCharacters in TextInput Custom Filter
How to use stripCharacters in TextInput at custom table filters, and ignoring the added character in search criteria? For example I have a filter to set minimum value of data, if the user typed 50,000, it become '50,000' in filter, where it should be 50000.
3 replies
FFilament
Created by dyo on 6/11/2024 in #❓┊help
Suggestion for dependant fields
Can someone suggest me what is the best approach for dependant fields.. In my case, I want my input total_price to be dependant to: 1. room_id, which is later will have to get a price attribute from room model, required 2. discount, numeric input, not required 3. additional_services (with repeater), has name and price attribute, can be 0 items or not required. So later, the input price will be a calculated data of those above 3 inputs. Currently the form is in resource class.. I'm using filament v2.
17 replies
FFilament
Created by dyo on 6/10/2024 in #❓┊help
Problem with afterStateUpdated in ViewField
Why after I upgraded my Filament to v3, the afterStateUpdated in ViewField is not working anymore? I want to fill other inputs based on data in ViewField.
25 replies
FFilament
Created by dyo on 6/6/2024 in #❓┊help
Missing filament primary color after version upgrade
No description
18 replies
FFilament
Created by dyo on 6/4/2024 in #❓┊help
Route [filament.pages.dashboard] not defined after filament upgrade
I just upgrading my filament version to v3. After running php artisan filament:install, i got error *Route [filament.pages.dashboard] not defined. * in /admin. I'm using custom Dashboard, and i've followed the steps from here https://filamentphp.com/docs/3.x/panels/dashboard#customizing-the-dashboard-page I've also tried running php artisan optimize. what am I missing?
20 replies
FFilament
Created by dyo on 5/24/2024 in #❓┊help
Problem in a stat overview in resource list
How can I have a stat overview widget in my resource list, that follows the query of table filters, when user filters the table and when user reset the filters in filament v2?
4 replies
FFilament
Created by dyo on 4/30/2024 in #❓┊help
Problem with updated data in form repeater
how to directly trigger a property in form repeater to be updated, when the repeater was cloned or deleted in filament v2? I want to live calculate other property based on data in the repeater. for example, a property in repeater is called 'list_data' and calculated property is called 'sum'.
4 replies
FFilament
Created by dyo on 4/30/2024 in #❓┊help
hide repeater item's header
No description
2 replies
FFilament
Created by dyo on 3/26/2024 in #❓┊help
Need help with how to create a loading modal
I have a page action to do some process for a bunch of data. Can someone give me suggestion how to show a loading bar while it processing in a modal with filament? So I can tell the user how many data will be processed and what is the progress.
3 replies
FFilament
Created by dyo on 3/14/2024 in #❓┊help
Porblem with resource link in multi tenancy
how can I create a list record resource link in <a href="">, if i'm using multi tenancy? I want to add the link in helperText in select form component.
->helperText(
new HtmlString(
'<a href="/admin/satuan" target="_blank">Ubah opsi satuan</a>'
)
),
->helperText(
new HtmlString(
'<a href="/admin/satuan" target="_blank">Ubah opsi satuan</a>'
)
),
What should I do?
2 replies
FFilament
Created by dyo on 3/7/2024 in #❓┊help
How close filament modal in custom page
<x-filament::modal id='custom-modal-handle'>
<x-slot name='header'>Tambah Nominal</x-slot>
<div>{{ $this->form }}</div>
<x-slot name="actions">
<div class="flex justify-end">
<button type="submit" wire:click='save'>
Simpan
</button>
</div>
</x-slot>
</x-filament::modal>
<x-filament::modal id='custom-modal-handle'>
<x-slot name='header'>Tambah Nominal</x-slot>
<div>{{ $this->form }}</div>
<x-slot name="actions">
<div class="flex justify-end">
<button type="submit" wire:click='save'>
Simpan
</button>
</div>
</x-slot>
</x-filament::modal>
I have this modal form in filament custom page. how can I close the modal when user submit the form?
7 replies
FFilament
Created by dyo on 3/7/2024 in #❓┊help
problem with customized searchable text column
https://filamentphp.com/docs/2.x/tables/columns/getting-started#searching Does anyone know the correct way to custom the results from searchable in textcolumn? So in this case, there is a cellphone column whose example data format is 6285265213796 but admin users often search for cellphone number data in the format of the results from copying and pasting numbers on WA, for example +62 852 6521 3796 I've tried
Tables\Columns\TextColumn::make('phone')
->searchable(query: function (Builder $query, string $search): Builder {
return $query->where('phone', ConvertPhone::number($search));
})
Tables\Columns\TextColumn::make('phone')
->searchable(query: function (Builder $query, string $search): Builder {
return $query->where('phone', ConvertPhone::number($search));
})
The classes and methods above are also used in other cases, and convert the cellphone number format correctly, according to the data in the database. but when used in textcolumn, the script above doesn't work as expected. What should I do?
6 replies
FFilament
Created by dyo on 2/24/2024 in #❓┊help
Refresh view column when a method in resource list is used
I'm working with viewColumn, there I have buttons, which is called a method from my list resource component. Can someone help me if I want the column to be refreshed if a method is called? the column
ViewColumn::make('follow_up')->disableClick()
->view('livewire.konfirmasi.follow-up'),
ViewColumn::make('follow_up')->disableClick()
->view('livewire.konfirmasi.follow-up'),
i've tried this in list resource component, but it's not working.
protected $listeners = [
'refresh' => '$refresh'
];

public function pending($id)
{
KirimPesanWhatsappPending::dispatch($id, 'Whatsapp');
$this->emit('refresh');
}
protected $listeners = [
'refresh' => '$refresh'
];

public function pending($id)
{
KirimPesanWhatsappPending::dispatch($id, 'Whatsapp');
$this->emit('refresh');
}
3 replies
FFilament
Created by dyo on 2/19/2024 in #❓┊help
Set the max width of viewColumn and wrap the text
No description
4 replies