Fogzy
Fogzy
FFilament
Created by Fogzy on 9/16/2024 in #❓┊help
Lower payload size
Hey, I have a table with 43 columns. Currently, loading 25 rows shows 2.35 MB in the network tab. When I comment all of them out, I get approx. 300 kB for that table. Is there any way to minimize the size? There are no crazy columns (no images etc.), just text.
3 replies
FFilament
Created by Fogzy on 7/16/2024 in #❓┊help
Pagination by group and not by items
Hey, I found this unanswered question on Github which I'm curious if anyone has a solution to: https://github.com/filamentphp/filament/discussions/12229 The thing is basically that we need to paginate based on groups, not the actual items (as in all ungrouped listings). Because then what happens is that a group is separated on two pages (at the end of the first one and the rest is on the top of the next page).
2 replies
FFilament
Created by Fogzy on 4/23/2024 in #❓┊help
Global Scopes not being ignored on select
I have this select:
Select::make('categories')
->relationship('categories', 'title', function (Builder $query): Builder {
return $query->withoutGlobalScopes();
})
->multiple()
->searchable()
->preload()
->required()
Select::make('categories')
->relationship('categories', 'title', function (Builder $query): Builder {
return $query->withoutGlobalScopes();
})
->multiple()
->searchable()
->preload()
->required()
And everything works fine until I save. Then the options that are displayed are not complete (it's obvious that the global scope is applied). I have global scopes disabled for the whole resource:
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->withoutGlobalScopes();
}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->withoutGlobalScopes();
}
The DB shows that the selected options got saved (4 rows). But the select only shows 3 options selected (since the 4th is blocked by the scope).
5 replies
FFilament
Created by Fogzy on 11/25/2023 in #❓┊help
SpatieTagsColumn pluck() on null after update
I'm using these versions: - spatie/laravel-tags (4.5.1) - filament/spatie-laravel-tags-plugin (v3.0.73) And everything works fine. When I tried updating v3.0.73 => v3.0.101, I run into an issue with the list view (form works fine). This is the code.
SpatieTagsColumn::make('tags')->sortable()->searchable(
true, function (Builder $query, string $search) {
$query->whereHas(
relation: 'tags',
callback: fn (Builder $q) => $q->where('name', 'like', "%{$search}%")
);
}),
SpatieTagsColumn::make('tags')->sortable()->searchable(
true, function (Builder $query, string $search) {
$query->whereHas(
relation: 'tags',
callback: fn (Builder $q) => $q->where('name', 'like', "%{$search}%")
);
}),
I get pluck() on null error. Any ideas what could be the problem?
9 replies
FFilament
Created by Fogzy on 10/25/2023 in #❓┊help
Multiple slashes (/) in the slug lead to 404
I have an Eloquent model Category. It has a slug that has multiple slashes, like animals-pet-supplies/pet-supplies/bird-supplies/bird-cage-accessories/bird-cage-bird-baths etc. The problem is that for this route: 'edit' => Pages\EditCategory::route('/{record}/edit'), I get a 404, probably because of multiple slashes. In Laravel router, I did this ->where('category', '.*') , which helped. Is there any way to do this in Filament? It's also OK to just use the ID, not the slug, but I have no idea how to do that. I tried protected static ?string $recordRouteKeyName = 'id'; with no luck.
5 replies
FFilament
Created by Fogzy on 8/24/2023 in #❓┊help
Individual searchable column - cannot remove from active filters
3 replies
FFilament
Created by Fogzy on 8/22/2023 in #❓┊help
Sticky table head
Hey guys, is there any native way to make the column names of a table "sticky" (when I scroll, I still see the column names)? Or do I have to create my own script/style?
4 replies