Kurja
using an accessor as the attribute in a selectFilter in table
Hi, is it possible to use accessor as filters in tables? I'm trying to use an accessor in a SelectFilter and I'm getting the following error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'publish_status' in 'where clause'My code is the following
$table->filters([
SelectFilter::make('status')
->label('Publish status')
->options([
'published' => 'published',
'scheduled' => 'scheduled',
'draft' => 'draft',
])
->attribute('publish_status'),
])
And the accesor in the model is the following
public function publishStatus(): Attribute
{
return Attribute::make(
get: function() {
if ($this->published_at) {
return 'published';
}
if ($this->scheduled_at) {
return 'scheduled';
}
return 'draft';
},
);
}
Any help appreciated, thanks in advance5 replies
Changing the base layout for panel
Hi, is there a way to change the base layout for the panel provider? I'm using both inertia and filament in my project and i need to disable livewire config "inject_assets" because it makes my inertia tests fail, but this makes the filament panel to not load the livewire scripts (this should be done manually using @livewireScripts, but the filament panel is apparently ignoring my app.blade.php layout in resources/views/components/layouts
4 replies