<Λmir>
<Λmir>
FFilament
Created by cicagorio on 4/2/2024 in #❓┊help
Column not found with table filter and joins
joining non-distinct will break table functionality. You can use the selected year from dropdown and instead of joining use the whereHas method to filter persons. Something like this:
->query(fn (array $data, Builder $query): Builder =>
$query->when(
$data['value'],
fn (Builder $query, $value): Builder =>
$query->whereHas('transactions', fn (Builder $query) =>
$query->where('transactions.year', $data[...])
)
)
)
->query(fn (array $data, Builder $query): Builder =>
$query->when(
$data['value'],
fn (Builder $query, $value): Builder =>
$query->whereHas('transactions', fn (Builder $query) =>
$query->where('transactions.year', $data[...])
)
)
)
4 replies
FFilament
Created by Mikail on 4/1/2024 in #❓┊help
->extremePaginationLinks() not working even as default
Did you used any pagination related packages for your models? This is the pagination view when you are using simple/cursor-based pagination.
19 replies
FFilament
Created by matin rajabi on 4/2/2024 in #❓┊help
how to update another model instead of updating current resource?
I recommend handle this in the Model level. You may use an Eloquent observer and the updating/updated method. You also can check weather specific field has been updated by using wasChanged.
public function updated(Post $post): void
{
if ($post->wasChanged('title')) {
// Title field has been updated.
}
}
public function updated(Post $post): void
{
if ($post->wasChanged('title')) {
// Title field has been updated.
}
}
Note: The updating/updated methods will not called at all when no fields has been changed.
12 replies
FFilament
Created by sdousley on 4/2/2024 in #❓┊help
Using Tailwind
You should make a filament theme first, then configure your panel to use it by viteTheme in your panel provider. https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme
5 replies