Fally
Fally
FFilament
Created by Fally on 9/20/2024 in #❓┊help
Help with opening modal in Page
Hi, I have a Resource Page I made and I'm trying to add a modal to it but I can't seem to open it using $dispatch. It says $dispatch is not defined. Any idea on how to trigger it? I have a <script> tag inside the page where I have my custom js from which I want to trigger the modal. I've used the info in the docs, if I use a button to trigger it like in the first example everything is ok, just javascript dispatching not working.
3 replies
FFilament
Created by Fally on 5/23/2024 in #❓┊help
Problem with dashboard loading all the widgets even those not defined in the panel provider
Hello, I made a stats overview widget to display in the header of a custom page. Even though I haven't added it to the widgets() function in the Panel Provider it still loads it on the dashboard after the defined widgets. How do I get rid of it? I only want to display it on the custom page I made. Do i have to override the Dashboard page?
6 replies
FFilament
Created by Fally on 12/22/2023 in #❓┊help
IconEntry not showing icon if value is null
I have an IconEntry that I want to use to display if something is ok or not. But if the value is null, it doesn't show up. Here's a code example:
IconEntry::make('apple_id')
->label('Apple login')
->icon(fn (string $state): string => !empty($state) ? 'heroicon-o-check-circle' : 'heroicon-o-x-circle')
->color(fn (string $state): string => !empty($state) ? 'success' : 'danger'),
IconEntry::make('apple_id')
->label('Apple login')
->icon(fn (string $state): string => !empty($state) ? 'heroicon-o-check-circle' : 'heroicon-o-x-circle')
->color(fn (string $state): string => !empty($state) ? 'success' : 'danger'),
If it's null I want it to display the red x mark but it just isn't processed. Any workaround?
2 replies
FFilament
Created by Fally on 11/9/2023 in #❓┊help
How to properly search encrypted columns in table
I was wondering what the proper way to search encrypted data is in Filament. I have columns with some sensitive information that I cast as encrypted in the model. Of course, searchable() is added on the column but naturally, it won't find the value in the database. What is the best approach here? Is it even doable?
4 replies
FFilament
Created by Fally on 9/13/2023 in #❓┊help
Dynamically created form schema setting other field value ignores what user changes as value
I'm going to try to explain this. I have a form in a relation manager. Based on a dropdown selection I build some extra fields using Forms\Components\Group::make()->schema(function ($get, $set, $context) {} For instance, in my case, i have a product selector and then i build some dropdowns with choices based on that product. These choices affect price so I use $set('unit_price', $price) in the form schema that i mentioned above to set the field value. unit_price is a normal defined form field, it's not dynamically created or anything. Problem is, if i edit the field value, manually, afterwards the data that is passed to the update function is what i set with $set, it ignores the actual current user inputed field value. I will attach a video where I will demonstrate that for entries where I don't have to use $set to set price, the data changes. https://share.cleanshot.com/fxkZdXxn
27 replies
FFilament
Created by Fally on 8/31/2023 in #❓┊help
Configurable string prefix to singular resource model name
No description
1 replies
FFilament
Created by Fally on 6/28/2023 in #❓┊help
Can I inject a variable amount of dropdowns based on reactive field value?
Hello, the use case is rather simple. I have a dropdown with some products. After selecting one I want to display a number of other dropdowns based on that selection. Might be 1 dropdown, might be 4. I don't know until the selection is made. Is that possible with form builder?
20 replies
FFilament
Created by Fally on 5/9/2023 in #❓┊help
How can I add a table footer in a relation manager?
I'm interested in showing a sum in the footer of a table that is in a relation manager. I can't find any way on how to do this. Is it even possible? Thank you,
5 replies
FFilament
Created by Fally on 3/19/2023 in #❓┊help
Any suggestions on speeding up filament?
I've recently deployed a large project (an ecommerce site) that uses filament as an admin panel. The server is pretty beefy (Xeon Quad Core, 16GB ram) but page loads and pagination seem quite sluggish. Are there any tips and tricks to further optimizing it? I'm not talking about tables where I have multiple queries and custom column views, but basic listing where I have 5 queries tops. I've noticed the same issue on way smaller scale projects on the same server. I'm running PHP 8.1 FPM with apache and mariadb 10.3. Laravel 9.
13 replies
FFilament
Created by Fally on 3/17/2023 in #❓┊help
Why doesn't model injection work for ActionGroup?
For instance, if I have a simple action like
Tables\Actions\Action::make('status_done')
->visible(fn (Order $record): bool => $record->some_value
Tables\Actions\Action::make('status_done')
->visible(fn (Order $record): bool => $record->some_value
then the record model is injected in the clojure. The problem is that when I have an ActionGroup, the same thing doesn't work. I'm trying to limit queries by doing the visibility verification in an actiongroup instead of each individual action. Is there something I'm missing here?
3 replies
FFilament
Created by Fally on 3/17/2023 in #❓┊help
How can I preload relationships in resource list
I'm trying to save on queries that I make on a list, mainly in actions and visibility checks so I'm trying to preload the relationships on the table query but I can't figure out a way to do this. Does anyone have any ideas?
2 replies