Masea
Masea
FFilament
Created by Masea on 2/23/2024 in #❓┊help
Can't listen to events on a custom field
I am dispatching event from an action that's inside an action form. The event is listened from a random method in the same resource form properly. But when I try to listen to it from the custom field in the same form it doesn't work. The custom field is like below:
<div
x-data="{
progress: 55,
updateText: ''
}"

x-on:progress-update="alert('lol')"
>
<progress :value="progress" max="100"></progress>
<span class="text-sm" x-html="updateText"></span>
</div>
<div
x-data="{
progress: 55,
updateText: ''
}"

x-on:progress-update="alert('lol')"
>
<progress :value="progress" max="100"></progress>
<span class="text-sm" x-html="updateText"></span>
</div>
the alert does not work. Any idea why? Thanks
1 replies
FFilament
Created by Masea on 2/20/2024 in #❓┊help
how to run javascript after clicking an action
I have an action that sets a field's value. The field is an hidden field which is responsible of only carrying the text value. In the same form, there is also an placeholder field, which is visible if the hidden field has set to a value and its content is set to display hidden field's value. What i would like to achieve is that whenever a new value set for the placeholder to display, trigger a script. This script will be a simple animation. Any idea how can i do this? Thanks!
4 replies
FFilament
Created by Masea on 1/24/2024 in #❓┊help
Table actions have loading indicator at all times
No description
22 replies
FFilament
Created by Masea on 1/17/2024 in #❓┊help
custom widget polling
I added a custom widget to one of my resource's edit page. I want it to be polled and I gave widget's view's root element a wire:poll attribute like this but it doenst work:
<x-filament-widgets::widget wire:poll.15s>
<x-filament-widgets::widget wire:poll.15s>
I would like to use stats widget since polling is in it. But I also need a button on my widget and afaik stat widgets do not support actions. Any idea?
2 replies
FFilament
Created by Masea on 1/4/2024 in #❓┊help
Using filament forms outside filament, how can i configure primary colors?
Pretty much the title
7 replies
FFilament
Created by Masea on 12/25/2023 in #❓┊help
custom field trigger live
I have a custom field, when its state is updated and when i use live() method it doesnt get triggered. I put a dd inside afterstateupdated method but it doesnt get triggered any idea why?
7 replies
FFilament
Created by Masea on 12/15/2023 in #❓┊help
how can i put script on a widget blade view?
i am going to have a widget that will run a script on its view. but no matter where I put the script it didnt work. here's my code: <x-filament-widgets::widget> <x-filament::section> </x-filament::section> <script> alert("hey") </script> </x-filament-widgets::widget> any idea why? thanks. this is a custom widget btw and i am using it on a custom page
19 replies
FFilament
Created by Masea on 11/22/2023 in #❓┊help
textinputcolumn lifecycle hook stop the action
TextInputColumn::make('sale_price')
->rules(['min:0', 'numeric'])
->type('number')
->beforeStateUpdated(function ($action, $record, $state) {
if ($state >= $record->price) {

$action->halt();
}
}),
TextInputColumn::make('sale_price')
->rules(['min:0', 'numeric'])
->type('number')
->beforeStateUpdated(function ($action, $record, $state) {
if ($state >= $record->price) {

$action->halt();
}
}),
I have a table colum like above in my project. Inside beforeStateUpdated, can I halt the process so it won't save the value to the database? The code doesn't work by the way as $action parameter is not resolved. Thanks
2 replies
FFilament
Created by Masea on 11/6/2023 in #❓┊help
$get doesn't work in action modal
Inside my infolist schema, I have an textentry with a hint action. the form loads perfectly well, but a dependant field (cargo_tracking_code) cannot get the status field's value. The code is attached.
15 replies
FFilament
Created by Masea on 10/26/2023 in #❓┊help
multiple tables in the same livewire component
Pretty much like multiple forms feature, is there a way to do it with tables?
11 replies
FFilament
Created by Masea on 10/19/2023 in #❓┊help
TagsInput afterStateUpdated() doesnt work
Apparently, afterStateUpdated() doesnt get triggered when TagsInput field is updated. Any idea what to do for this?
5 replies
FFilament
Created by Masea on 8/25/2023 in #❓┊help
Updating another column if a column was dirty using observer results in stack overflow
public function saveProfile(): void
{
$this->user->update(
$this->profileForm->getState(),
);
}
public function saveProfile(): void
{
$this->user->update(
$this->profileForm->getState(),
);
}
This is my submit function of the form.
public function updated(User $user)
{
if ($user->isDirty('username')) {
$user->update([
'username_changed_at' => now()
]);
}
}
public function updated(User $user)
{
if ($user->isDirty('username')) {
$user->update([
'username_changed_at' => now()
]);
}
}
and this is the observer. When I submit the form, it goes into a infinite loop, idk why. Any idea to solve this? Thanks
1 replies
FFilament
Created by Masea on 8/4/2023 in #❓┊help
How can I ->fill() a FileUpload field?
I tried giving the path to the file, no help. Any way to do this?
6 replies
FFilament
Created by Masea on 7/30/2023 in #❓┊help
Fields with same name within different section fields
No description
6 replies
FFilament
Created by Masea on 7/29/2023 in #❓┊help
Table column record parameter for visible & hidden methods
6 replies
FFilament
Created by Masea on 7/29/2023 in #❓┊help
Default value for checkboxes and toggles
26 replies
FFilament
Created by Masea on 7/13/2023 in #❓┊help
Adding filters to a Page and manipulating its widgets' content with them
Can I somehow add filters to a Page and then pass the filter values through a widget and use it inside the widget? I am using the FullCalendar plugin and it is limited only to dates when it comes to filtering the calendar content. In this plugin, the calendar is contained inside a widget hence my question.
10 replies
FFilament
Created by Masea on 7/11/2023 in #❓┊help
relationshipmanager for belongsToMany relationship with pivot table tries to insert into wrong table
26 replies
FFilament
Created by Masea on 6/30/2023 in #❓┊help
multiple resources with the same policy leads to unwanted action when used with roles and permission
hey, can i somehow override the can method inside resource class to make the resource use different policy without knowing its model? because i have multiple resources that are tied to the same model. as i see it, the current can method checks the policy tied to the model. but if you ask me, resource dependant policies make the most sense i am dealing with this because i am using the shield plugin. even though it displays and lets me edit the permissions on a resource basis, it doesnt matter in the end of the day because all those resources are tied to the same model -_-
2 replies