Auth1Specialist
Auth1Specialist
FFilament
Created by TheRealTeeHill on 1/22/2025 in #❓┊help
Dashboard widgets: drag and drop
5 replies
FFilament
Created by Auth1Specialist on 1/22/2025 in #❓┊help
Triggering editaction on Stat click
OK, I figured it out:
#[On('widget-edit')]
public function widgetEdit(string $id): void
{
$this->mountAction('editDashboardAction', ['id' => $id]);
}
#[On('widget-edit')]
public function widgetEdit(string $id): void
{
$this->mountAction('editDashboardAction', ['id' => $id]);
}
The click events dispatches this event. Which will trigger the modal to open.
5 replies
FFilament
Created by Auth1Specialist on 1/22/2025 in #❓┊help
Triggering editaction on Stat click
Ah, I have made some progress here. The issue seems to be the action isn't mounted. So fiddling with mounting the action before calling it. Will report back with a full solution if I find one.
5 replies
FFilament
Created by Ne on 1/22/2025 in #❓┊help
Select the option Obstructed from view by repeater
I think I had something similar in the past as well. Can you try with
->native(false)
->native(false)
and see if you still have it?
14 replies
FFilament
Created by TheRealTeeHill on 1/22/2025 in #❓┊help
Dashboard widgets: drag and drop
No description
5 replies
FFilament
Created by Oddman on 1/7/2025 in #❓┊help
Man... Filament is so damn slow :(
Can you do some profiling to see what's causing this delay? (Or do some caveman debugging, by commenting parts out / returning early, doing the call a few times, and check the time it takes) ... If you have really big components with a lot of selects that load data, it can significantly slow things down, but without more information it's a bit hard to help here IMO. Some general tips and tricks I can give: - Is this on every request? Or just with working with some components? If it's on some components, I have some tips that I use myself (These are generally for Livewire, so these work for Filament as well.): - Work with private properties in Livewire components as much as possible, when they are public they have to get diffed / synced / ... every time - I also have a lot of success with caching filament Forms in my components, like so:
private array $componentCache = [
AgendaAppointment::class => [],
AgendaTemplate::class => []
];

Then in my actions:
public function createAgendaTemplateAction() {
if (!array_key_exists('agendaTemplateForm', $this->componentCache)) {
$this->componentCache['agendaTemplateForm'] = AgendaTemplate::form();
}
}
private array $componentCache = [
AgendaAppointment::class => [],
AgendaTemplate::class => []
];

Then in my actions:
public function createAgendaTemplateAction() {
if (!array_key_exists('agendaTemplateForm', $this->componentCache)) {
$this->componentCache['agendaTemplateForm'] = AgendaTemplate::form();
}
}
I do that because these are big forms with a lot of relations / .... and these get used in the createAction, editAction, ... so normally these are initialised multiple times, meaning duplicate queries meaning longer load times ... - Other than that, I also split Livewire components if they get too large.
30 replies
FFilament
Created by matthias on 12/19/2024 in #❓┊help
Add part of filament in external Page
How I did it (temporarily) was the following, but this worked: - Create full page Livewire (filament) components - Set livewire inject_assets to TRUE in the config - Load the full page with HTMX inside of your old page
13 replies
FFilament
Created by treii28 on 12/16/2024 in #❓┊help
Why does nothing in this #$%^#$ work as described in docs?
I would also like to give some tips here: - Setup xdebug to debug PHP code that gets executed; - Laracast also have some great series on PHP / Alpine / ... as well. Not tutorials mind you (they also have those), but explainers on how the libraries (high-level) work. The way you grow as a developer is to realise everything you need of information is actually in the code (if you take the approach of digging into the libraries source-code, you will learn much faster). Good luck!
51 replies
FFilament
Created by Zod on 12/17/2024 in #❓┊help
Add action to a wizard step
This might work: - You could create your own custom field -> Load a custom livewire component in it -> Set it to load lazy -> Use it in your wizard as a form -> Run code in the mount() method?
8 replies
FFilament
Created by Auth1Specialist on 12/14/2024 in #❓┊help
Repeater optimistic UI with livewire
Yea. Figured as much. Hmmn, OK, let me go down the rabbithole ^^. I will report back when I got it working :D. Jep, I agree on the "optimistic" comment. In my mind it was something like: "Show what the UI would be before the roundtrip happens. So I didn't know how to differently name it than "optimistic UI". Thanks for the answer!
7 replies
FFilament
Created by Auth1Specialist on 12/14/2024 in #❓┊help
Repeater optimistic UI with livewire
Specifically I am looking to alter the "Add " / "Delete"-actions to rapidly display / remove a new record without a roundtrip. So when clicking, a new row gets added (or the row gets deleted) without doing a roundtrip. Deleting the record seems quite doable. But I am afraid that creating a new item will be pretty tricky (generating new form elements that play nicely with the current livewire BE actions, which also can be altered afterwards using the $get and $set seem a bit harder).
7 replies