devpoolxx
devpoolxx
FFilament
Created by devpoolxx on 9/2/2024 in #❓┊help
Filament table builder using union query
I have a table with custom union query combining records from 2 tables. The list is displayed properly but when clicking the record, it gives the wrong model and some records have the same ID thus giving back the wrong record. Is there a way so let filament table know which column should be the unique? ```
7 replies
FFilament
Created by devpoolxx on 8/5/2024 in #❓┊help
How to use datepicker inside a custom blade component?
``
2 replies
FFilament
Created by devpoolxx on 6/3/2024 in #❓┊help
Use infolist instead of table in a relation manager.
I currently have a relationManager that displays a table, however I want to have a button to switch the table view into a infolist. Is it possible to do that?
5 replies
FFilament
Created by devpoolxx on 5/7/2024 in #❓┊help
How to dispatch action using Notification inside a ListRecord class
No description
5 replies
FFilament
Created by devpoolxx on 4/19/2024 in #❓┊help
How to close action confirmation modal after form validate fails?
I have a custom livewire component that has a form with rules and submit action.
public function submitAction(): Action
{
return Action::make('submit')
->button()
->icon('heroicon-s-plus-circle')
->label('Add talent profile')
->requiresConfirmation()
->action(function () {
$this->validate();
});
}
public function submitAction(): Action
{
return Action::make('submit')
->button()
->icon('heroicon-s-plus-circle')
->label('Add talent profile')
->requiresConfirmation()
->action(function () {
$this->validate();
});
}
The problem is when there are validation errors, I cannot close this confirmation modal automatically.
9 replies
FFilament
Created by devpoolxx on 4/18/2024 in #❓┊help
Custom page with form and select input
I have this custom page:
<?php

namespace App\Admin\Resources\TalentResource\Pages;

use App\Admin\Resources\TalentResource;
use App\Models\Skill;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Resources\Pages\Page;
use Illuminate\Contracts\View\View;

class ReviewTalent extends Page
{
use InteractsWithForms;

protected static string $resource = TalentResource::class;

protected static string $view = 'admin.resources.talent-resource.pages.review-talent';

public $first_name;
public $content;

public function mount(): void
{
$this->first_name = 'testing12312';
}

protected function getFormSchema(): array
{
return [
Select::make('skill_ids')
->multiple()
->label('Skills')
->columnSpanFull()
->getSearchResultsUsing(fn (string $search): array => Skill::where('value', 'ilike', "%{$search}%")->limit(40)->pluck('value', 'id')->toArray())
->getOptionLabelsUsing(fn (array $values): array => Skill::whereIn('id', $values)->pluck('value', 'id')->toArray())
->required()
];
}

public function submit()
{
dd($this->form->getState());
}
}
<?php

namespace App\Admin\Resources\TalentResource\Pages;

use App\Admin\Resources\TalentResource;
use App\Models\Skill;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Forms\Form;
use Filament\Resources\Pages\Page;
use Illuminate\Contracts\View\View;

class ReviewTalent extends Page
{
use InteractsWithForms;

protected static string $resource = TalentResource::class;

protected static string $view = 'admin.resources.talent-resource.pages.review-talent';

public $first_name;
public $content;

public function mount(): void
{
$this->first_name = 'testing12312';
}

protected function getFormSchema(): array
{
return [
Select::make('skill_ids')
->multiple()
->label('Skills')
->columnSpanFull()
->getSearchResultsUsing(fn (string $search): array => Skill::where('value', 'ilike', "%{$search}%")->limit(40)->pluck('value', 'id')->toArray())
->getOptionLabelsUsing(fn (array $values): array => Skill::whereIn('id', $values)->pluck('value', 'id')->toArray())
->required()
];
}

public function submit()
{
dd($this->form->getState());
}
}
with this blade component
<x-filament-panels::page>
<x-filament-panels::form wire:submit="submit">
{{ $this->form }}
<div>
<x-filament::button type="submit" size="sm">
Submit
</x-filament::button>
</div>
</x-filament-panels::form>
</x-filament-panels::page>
<x-filament-panels::page>
<x-filament-panels::form wire:submit="submit">
{{ $this->form }}
<div>
<x-filament::button type="submit" size="sm">
Submit
</x-filament::button>
</div>
</x-filament-panels::form>
</x-filament-panels::page>
The problem is the multiple option on Select component, whenever I type on the field, it throws ComponentNotFoundException..
6 replies
FFilament
Created by devpoolxx on 1/16/2024 in #❓┊help
Table action modal calling 2 more `update` endpoints when being closed.
Filament v3 upgraded, the performance is really fast on my local but on dev server (ec2 with t2.medium). The slowness is really noticeable when clicking a table action that opens a modal with infolist. After closing it, there 2 more api calls that are very slow to this endpoint: livewire/update which blocks the next action so clicking other record wont fire and then the modal wont get displayed. Also I cannot find in documentation on how to show table skeleton loading which are present by default on v2. Thank you very much in advance 🙂 and thank you for your work on filament 🙂
1 replies