kingtox
kingtox
FFilament
Created by kingtox on 4/19/2024 in #❓┊help
Eager load issue
No description
9 replies
FFilament
Created by kingtox on 4/14/2024 in #❓┊help
How to avoid duplicate queries
No description
6 replies
FFilament
Created by kingtox on 9/9/2023 in #❓┊help
How to access the Search variable inside recordSelectOptionsQuery of Relation Manager
i am working on advance relationship which is Many to Many Polymorphic, all the relation are working fine for attach and detach, however when i search for specific name in the AttachAction it shows an error, is there any way we can disable $recordTitleAttribute and search for the record in recordSelectOptionsQuery() this is what i tried so far!
AttachAction::make()
->label('Attach Employee')
->recordTitle(fn (Model $record) => $record->user->name)
->recordSelectSearchColumns(['name'])
->recordSelectOptionsQuery(fn(Builder $query, $livewire) => $query->whereHas('user'))
->form(fn (AttachAction $action): array => [
$action->getRecordSelect()
->label('Select Employee Profile')
->placeholder('Search Profile')
->disableLabel(false),
])
->preloadRecordSelect()
->modalHeading('Attach Employee')
AttachAction::make()
->label('Attach Employee')
->recordTitle(fn (Model $record) => $record->user->name)
->recordSelectSearchColumns(['name'])
->recordSelectOptionsQuery(fn(Builder $query, $livewire) => $query->whereHas('user'))
->form(fn (AttachAction $action): array => [
$action->getRecordSelect()
->label('Select Employee Profile')
->placeholder('Search Profile')
->disableLabel(false),
])
->preloadRecordSelect()
->modalHeading('Attach Employee')
i would like to search for a record in $query->whereHas('user')
3 replies
FFilament
Created by kingtox on 4/16/2023 in #❓┊help
How can i change tableRecord key?
i try this but it doesn't work, any help please?
public function getTableRecordKey(Model $record): string
{
return $record->user_id;
}
public function getTableRecordKey(Model $record): string
{
return $record->user_id;
}
on resource i was able to change it but on table it doesn't work.
public static function getRecordRouteKeyName(): string
{
return 'user_id';
}
public static function getRecordRouteKeyName(): string
{
return 'user_id';
}
3 replies
FFilament
Created by kingtox on 4/12/2023 in #❓┊help
Eager loading relationships in table
3 replies
FFilament
Created by kingtox on 3/14/2023 in #❓┊help
HasManythrough showing wrong owner record Id
Hey 👋 In my model I have a relationship public function resultLog() { return $this->hasManyThrough( ResultLog::class, Result::class, 'user_id', 'result_id', 'id', 'id' ); } I define primary key in my modal as a user_id, but for some reason the relation manager is showing wrong user_id of the owner record, it shows random user_id.
20 replies
FFilament
Created by kingtox on 3/11/2023 in #❓┊help
hide a column in table builder
I have a relation manager, In relation manager I wanted to hide a column in table builder. I try this Tables\Columns\IconColumn::make('saml') ->boolean() ->trueIcon('heroicon-o-badge-check') ->falseIcon('heroicon-o-x-circle') ->hidden(fn($record) => dd($record->saml == 1)), But it’s giving me an error Attempt to read property "saml" on null
4 replies
FFilament
Created by kingtox on 3/3/2023 in #❓┊help
How to change resource Button label?
I have a resource with the relationship I want to change its button label, is there any way to do it. Thank you 🙏
2 replies