orestebh
How list according to the tab selected in the table
Hello, how could I obtain the list of resources and show it according to the tab that is active in filamentphp. Ex: In the user resource, if I check the doctor tab, show the doctors table. But on the same user page?
2 replies
How implement a filter in a filament resource that uses the attribute of a HasOne relationship
Hello everyone. I have a question, how can I implement a filter in a filament resource that uses the attribute of a HasOne relationship. For example, I have two models Author and Profile, where Author hasOne Profile and Profile belongsTo Author. In profile there is the boolean attribute is_featured. What I want is to filter the list of authors by that attribute. I tried TernaryFilter::make('profile.is_featured') but it shows me all the authors.
3 replies
Help with getTableQuery method
I am trying to modify the query generated by eloquent for the listing of a resource, which is a (select *) and I want to put only specific columns (select name, institution_id, etc) not all of them. I am overriding the getTableQuery method in the resource but it keeps executing the query with * on the listing page. Any suggestions?
protected function getTableQuery(): Builder
{
return parent::getTableQuery()
->select('name', 'institution_id', 'created_at', 'type_id', 'job_order_id');
}
and the query in filament list page:
select * from
job_job
order by activation_date
desc, updated_at
desc limit 10 offset 03 replies
Error: Method Filament\Forms\Components\Actions\Action::isModalClosedByClickingAway does not exist
Hello everyone, I hope you can help me with this error, I am following an article about "to add GPT-3 Modal to Input Fields in FilamentPHP", this is the link https://helgesver.re/articles/add-openai-gpt-in-filament-fields . But when I access the button, it shows me this error: Method Filament\Forms\Components\Actions\Action::isModalClosedByClickingAway does not exist.
2 replies