Fabio Umpierre
Difficulty creating a filter with a relationship using getTableFilters
Good afternoon everyone, how are you? I'm trying to make a filter between my instances and subscription table
Here is my relationship:
public function subscript()
{
return $this->belongsTo(Subscription::class, 'id', ['installable_id']);
}
getTableQuery and filter:
public function getTableQuery(): Builder
{
return Instance::where('business_id', Business::current()->id)->where('name', '!=', 'IA Instance');
}
public function getTableFilters(): array
{
return [
SelectFilter::make('subscript')
->options(SubscriptionStatus::options())
->label('Status')
->relationship('subscript', 'status'),
];
}
query obtained:
select
count(*) as aggregate
from
instances
Where
business_id = 1
and name != 'IA Instance'
and (
exists (
select
*
from
subscriptions
Where
instances.id = subscriptions.installable_id
and subscriptions.installable_id = 'active'
)
)
'active' would be one of the selectFilter options
problem:
Only the ending is wrong and should be:
and subscriptions.status = 'active'
what am I wrong?
Note: I'm using v2 of the filament
3 replies
Call to undefined method Illuminate\Database\Eloquent\Relations\MorphOne::getQualifiedOwnerKeyName()
model instance
public function subscription()
{
return $this->morphOne(Subscription::class, 'installable');
}
public function getTableQuery(): Builder
{
return Instance::where('business_id', Business::current()->id)->where('name', '!=', 'Instância IA');
}
public function getTableFilters(): array
{
return [
SelectFilter::make('subscription')->relationship('subscription', 'status')
];
}
I'm getting this error in getTableFilter, has anyone experienced this?
1 replies
modal opens in the same step when closed without reloading the page
Good afternoon everyone, how are you?
I have a modal that, when opened, displays a qr-code and an option to receive a code
If I click on receive the code, it goes to a second modal to enter the phone number, and the third shows the code on the screen.
The problem is that when I close the modal in the second or third step, and open it again, it should return to step 1, but it opens exactly where I closed it with all the information.
This only doesn't happen if I close the modal, reload the page and then open it again
the code is in an attached file
3 replies
Hinticon tooltip argument is not recognized
Good evening everyone, how are you? I'm trying to create a tooltip with filament, but the tooltip argument where the tooltip text is passed is not recognized, I took it straight from the documentation. Any idea what's going on?
TextInput::make('assistent.group_name')
->placeholder(('assistent::setup.one.form.placeholder.group_name'))
->label(('assistent::setup.one.form.label.group_name'))
->hintIcon('heroicon-o-question-mark-circle', tooltip: 'test')
error: Unknown named parameter $tooltip
9 replies