Jellibloom
Jellibloom
FFilament
Created by Jellibloom on 3/31/2024 in #❓┊help
How to trigger an action from a TextColumn
Found the answer
->action(function (Reservation $record, $livewire) {
$livewire->mountTableAction('writeReview', $record->id);
}
->action(function (Reservation $record, $livewire) {
$livewire->mountTableAction('writeReview', $record->id);
}
4 replies
FFilament
Created by Jellibloom on 3/31/2024 in #❓┊help
How to trigger an action from a TextColumn
I've tried this, but not working $table->getAction('writeReview');
4 replies
FFilament
Created by Jellibloom on 3/27/2024 in #❓┊help
How to use same column attribute in a Table Filter AND in Listing records (Using tabs to filter)
the other half of the solution solved by this
Tables\Filters\SelectFilter::make('status')
->options(function (HasTable $livewire) {
$livewire->activeTab = null;
return Enums\ReservationStatus::class;
})
Tables\Filters\SelectFilter::make('status')
->options(function (HasTable $livewire) {
$livewire->activeTab = null;
return Enums\ReservationStatus::class;
})
4 replies
FFilament
Created by Jellibloom on 3/27/2024 in #❓┊help
How to use same column attribute in a Table Filter AND in Listing records (Using tabs to filter)
So I want to reset a specific filter on tab filter, and vise versa I found the first have of the solution, on the list page I added this function
public function updatedActiveTab(): void
{
$this->tableFilters['status']['values'] = null;
}
public function updatedActiveTab(): void
{
$this->tableFilters['status']['values'] = null;
}
4 replies
FFilament
Created by Jellibloom on 3/26/2024 in #❓┊help
How to attach and detach a relation in case there were values
Found the solution 😄 https://filamentphp.com/docs/3.x/forms/advanced#conditionally-saving-data-to-a-relationship
->relationship(
'review',
fn (?array $state): bool => filled($state['rating'])
)
->relationship(
'review',
fn (?array $state): bool => filled($state['rating'])
)
3 replies
FFilament
Created by Jellibloom on 3/25/2024 in #❓┊help
How to validate inside `handleRecordCreation()` or `mutateFormDataBeforeSave`
You're a life saver man, thanks!
6 replies
FFilament
Created by Jellibloom on 3/25/2024 in #❓┊help
How to validate inside `handleRecordCreation()` or `mutateFormDataBeforeSave`
Hey @Leandro Ferreira, and thanks a lot for your help! I'm using a repeater, and I want to get values that are outside the repeater I added this rule to one of the repeater attributes, but I it only get the values inside a single repeater
->rules([
fn (Forms\Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) {
info($get('id'));
->rules([
fn (Forms\Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) {
info($get('id'));
So that's why I thought of making the validation inside handleRecordCreation and mutateFormDataBeforeSave, but then wondered how to display the validation error before running $this->halt();
6 replies
FFilament
Created by afdhal on 3/1/2024 in #❓┊help
Import Action Relation with OptionForm
Thanks for sharing the solution I was trying to it like below but was getting error
$this->data['city_id'] = $this->options['city_id'];
return new Area();
$this->data['city_id'] = $this->options['city_id'];
return new Area();
6 replies
FFilament
Created by Jellibloom on 3/19/2024 in #❓┊help
Filter enum value from select enum options (get all enum values but selected ones)
Thanks a lot @Leandro Ferreira , didn't know that!
5 replies
FFilament
Created by Jellibloom on 3/19/2024 in #❓┊help
Filter enum value from select enum options (get all enum values but selected ones)
I have tried doing this but didn't work
->options(function (Forms\Get $get) {
return collect(CarType::cases())->where('name', '!=', $get('car_type'))->pluck('name', 'value')->toArray();
})
->options(function (Forms\Get $get) {
return collect(CarType::cases())->where('name', '!=', $get('car_type'))->pluck('name', 'value')->toArray();
})
5 replies