beuzathor
beuzathor
FFilament
Created by beuzathor on 11/10/2024 in #❓┊help
Issue with Table Summarizer visibility not updating when filters change
I'm trying to show/hide a Sum summarizer based on specific filters being active. I can successfully detect the filters using $table->getLivewire()->tableFilters['remise']['value'], but there seems to be a timing issue. The summarizer only updates its visibility when the page is fully refreshed. When applying filters through the UI, even though the table data updates via Livewire, the summarizer's visibility state doesn't update until a full page refresh occurs. Here's my current code: Tables\Columns\TextColumn::make('montant') ->label('Montant') ->summarize( Tables\Columns\Summarizers\Sum::make() ->visible(fn(Table $table) => !empty($table->getLivewire()->tableFilters['remise']['value'] ?? null) || !empty($table->getLivewire()->tableFilters['remiseancv']['value'] ?? null) ) ) The filter detection works correctly (I can see the proper values in tableFilters), but the visibility state only updates after a full page refresh. Is there a way to force the summarizer to re-evaluate its visibility when filters are applied without requiring a page refresh?
2 replies
FFilament
Created by beuzathor on 10/17/2024 in #❓┊help
tiptap editor + modal + block
I'm using TipTap editor and I'm encountering a problem related to modals when I use them in a custom block. When I go to edit a custom block that contains another TipTap editor, I can't use plugins that require a modal. In this case, the modal opens and I can enter a link or select a photo, but when I validate, there's a small freeze and the information is not reflected in the text. In summary, I have this problem only with the link plugin and the media plugin. The rest works fine.
3 replies
FFilament
Created by beuzathor on 8/12/2024 in #❓┊help
use of EditAction in a foreach loop loads all the forms
I am using a Blade template that iterates over elements in a loop. For each element, I load a Livewire component that returns an EditAction allowing the element to be edited. So, I have this in my Blade template: blade @foreach ($sejours as $sejour) <livewire:edit-sejour-commande :sejourscommande="$sejour" wire:key="edit-sejour-commande-{{$sejour->id}}-{{ now()->timestamp }}" /> @endforeach In the Livewire component, I return the form using EditAction like this: php Copier le code public function editAction(): Action { return EditAction::make() ->record($this->sejourscommande) ->form(function (Form $form) { return $form->schema( SejourCommandeForm::schema(), ); }) ->using(function (Model $record, array $data): Model { return $this->handleSejourscommandeUpdate($record, $data); // Call the trait method }) ->slideOver(); } Everything works fine and functions as expected. The issue is that if I display many elements on the page, it loads as many forms and Livewire components, which could cause problems. So, I wanted to know if there's a way to only load the EditAction button initially and load the form only when the button is clicked.
3 replies
FFilament
Created by beuzathor on 7/24/2024 in #❓┊help
Edit relationship in table (belongtomany) in modal
Hello, I am looking for the best way to display in a table the list of a command's relationships to be able to edit them individually via a modal. The project I am working on includes orders, and within each order, there are several stays. So, the listcommande table has a relation like this: php Copier le code public function sejourscommande() { return $this->hasMany(Sejourscommande::class); } Currently, I am using split/stack to make the display of stays within the order collapsible. The display works fine, but I am not sure what solution to use to be able to edit the stays. My current code for displaying the table is as follows (I am using a view to loop through the stays, but I am not sure if this is the right solution):
Note that I thought about adding a button in my view to send the ID of the stay to edit, but as soon as I add a button in the Blade view, even with nothing inside and no class, I get a dozen errors in the console related to Alpine JS. But that is another problem I don't understand. Feel free to ask if you need further adjustments or additional details!
5 replies
FFilament
Created by beuzathor on 1/10/2024 in #❓┊help
Multi-auth and broadcast
Hello, I am currently working on a project using Filament 3 and have encountered an issue with broadcasting, particularly in the context of a multi-authentication (multi-auth) setup. In my application, I have two types of users: 'user' and 'customer', each with their own authentication guards. The broadcasting feature works fine for 'user' type accounts, but I am facing difficulties enabling it for 'customer' type accounts. Here is a brief overview of my current setup: 1. Broadcasting Configuration: I have configured Laravel Echo and Pusher in my filament.php configuration file. The relevant settings are as follows: ```php 'broadcasting' => [ 'echo' => [ 'broadcaster' => 'pusher', 'key' => env('PUSHER_APP_KEY'), 'cluster' => env('PUSHER_APP_CLUSTER'), 'wsHost' => env('PUSHER_HOST'), 'wsPort' => env('PUSHER_PORT'), 'wssPort' => env('PUSHER_PORT'), 'authEndpoint' => '/broadcasting/auth', 'disableStats' => true, 'encrypted' => true, ], ], Issue: The route /broadcasting/auth is only accessible to users authenticated as 'user'. Customers, who are authenticated using a different guard, cannot access this route and therefore do not receive broadcasts. Attempts to Resolve: I have tried customizing the BroadcastServiceProvider and the authentication logic in the BroadcastController to accommodate both 'user' and 'customer' types but without success. Given this context, I'm seeking guidance or suggestions on how to properly configure broadcasting in Filament 3 for a multi-auth system. Is there a specific approach or configuration that I'm missing? Any advice or insights would be greatly appreciated. Thank you in advance for your help! Best regards,
2 replies
FFilament
Created by beuzathor on 1/7/2024 in #❓┊help
Get path for builder/block input
I have a builder on a page and I can therefore generate several blocks which each contain an input text with the name XXX. But once the blocks are generated, all the input elements have the same name (XXX). I'm looking for ways to target them one by one, for example to add content.
5 replies
FFilament
Created by beuzathor on 1/6/2024 in #❓┊help
Use the builder as a template with relationship
Good morning, I'm looking to use the builder to create a template system. So I created an EditorTemplate model and a Document model. Document is in BelongTo with templateEditor. So in my templateEditor I define the different sections of the page via the builder. Everything works well on this side. Now I want the documents to display exactly the fields defined in the template, therefore via the relationship. I was thinking of displaying a builder on the page and placing the content of the relationship in it but I can't find how to do it.
2 replies