Benjamin
Table filters : column not found, why ?
Hi everyone ! Is someone here capable to explain how/why table filters have no access to table query column ?
For example : Let's say I have a users table with a calculated "availabilityScore" column (percentage, from 0 to 100). If I want a filter for that "availabilityScore", I can't just use
->where('availabilityScore', '>', 10)
because it will throw a column not found
error.
Why filters are not just modifying the table query ? I'm sure there is good reasons, I just need to understand 🙂 Thanks !7 replies
Why wire:dirty not working with <x-filament::> components ?
Hi guys ! I'm writing some custom Livewire components and I'm using some Filament blade components inside of them to keep the UI consistent.
I'm trying to use
wire:dirty
on a Filament button but it doesn't work. It works on a basic HTML button, do you know why ?
3 replies
Struggling with SelectFilter with relationship() and distinct status (Enum)
Hi guys ! I want to make a filter or the
abacus_status
in my users
table but this status is in another table user_details
, linked to the users via the details()
relationship. What is wrong in my code ?
ERROR : Object of class App\Enums\Users\AbacusStatusEnum could not be converted to string
3 replies
Custom rule based on another field - Good way or not ?
I'm implementing a custom rule that verify that two dates are in the same year.
Custom Laravel Rule
Filament Form schema()
It works, but is that right do it like that ?
I started using
DataAwareRule
but the problem is that the form data are stored in a "sub-array" and therefore if I use $this->data['data']['field-name'] the rule will works with Filament (Livewire?) but not in another classic class like a Controller
.
2 replies
validate() vs getState()
Hi guys ! I'm using a custom Form inside a Livewire component and I need to understand the difference between
validate()
and getState()
. Here is my code :
I'm reusing form fields across multiple forms and some fields needs to be hidden (for the user + in the data), like this one :
8 replies
Modify/add colors when using Filament outside of panel
Hi guys ! I'm trying to change colors of Filament components and I was able do to it for the Panel but not for the blade component used outside such as
<x-filament::link/>
.
I tried this in my tailwind.config.js
but it doesn't work :
Anyone can help ?3 replies
DatePicker/DateTimePicker alternative with manual typing support
Does anyone here already made a custom
DatePicker
/DateTimePicker
or found an alternative version that allow manual typing ? I really need it and I know some people already asked for it (https://github.com/filamentphp/filament/discussions/6209 and https://github.com/filamentphp/filament/discussions/6817) so maybe I don't have to do it from scratch.
Edit : It' s possible to use ->type('datetime-local')
, but then I lost all DatePicker great utilities such as firstDayOfWeek()
, disabledDates()
, minDate()
and maxDate()
. Yes, minDate()
and maxDate()
can be replaced by something like ->extraInputAttributes(['max' => now()->isoFormat('YYYY-MM-DDTHH:mm')])
, but the problem is that when using TextInput
with a specific type
, the field is not updated when using refreshFormData
and a complete page reload (F5) is necessary.
Thanks 🙏14 replies
Refresh my form after custom "Cancel" action
Hi guys. I created an action that allow to cancel a mission (switch status + fill cancellation related fields). Those fields are visible on my
MissionResource.php
only if the status is CANCELLED.
The problem is, when the action is performed, the fields appears but they are not fill with the data I just typed, but those that where loaded at the loading of the page. I tried to use protected $listeners = ['refreshEditMissions' => '$refresh'];
on the EditMissions.php
page and dispatch the event in the action, I tried to use the refreshFormData
method, but nothing is working. Please help 🙏
Here is my action code : https://pastebin.com/LNDJSQt64 replies
JS error : "Livewire assets are out of date"
Hi guys, I made a few changes on my Filament app and now login isn't working anymore and I think it's related to Livewire because I have this error in the console and even the password input doesn't work anymore. Do you have any advice to help me ? I'm struggling since 2 hours on it...
I also tried , then livewire is correctly loaded but the login is just redirecting me to the login page.
6 replies
Unique rule with MorphToSelect fields
Hi ! I'm trying to create a form for a
"relations"
polymorphic table I have in my database to manage relations between three entities (Users, Companies and Institutions). Here is the table code :
I already used ->unique()
method on classic Select fields like that :
But is there any possibility define a unique()
rule on MorphToSelect
fields ?
Thanks in advance !2 replies