Mombei
Mombei
FFilament
Created by billyma121182 on 4/10/2025 in #❓┊help
SelectFilter ordering
Since you're using the relationship() method, you can order the results of the query with its modifyQueryUsing parameter:
use Illuminate\Database\Eloquent\Builder;

SelectFilter::make('ItemProjectID')
->relationship(
name: 'project',
titleAttribute: 'ProjectName',
modifyQueryUsing: fn(Builder $query): Builder => $query->orderBy('id', 'desc')
)
//omitted for brevity
use Illuminate\Database\Eloquent\Builder;

SelectFilter::make('ItemProjectID')
->relationship(
name: 'project',
titleAttribute: 'ProjectName',
modifyQueryUsing: fn(Builder $query): Builder => $query->orderBy('id', 'desc')
)
//omitted for brevity
https://filamentphp.com/docs/3.x/forms/fields/select#customizing-the-relationship-query
3 replies
FFilament
Created by Mombei on 2/24/2025 in #❓┊help
Relation Manager in Tab component of parent Resource
No description
6 replies
FFilament
Created by Mombei on 2/24/2025 in #❓┊help
Relation Manager in Tab component of parent Resource
Repeaters can handle HasMany (one-to-many) relationships, I need to handle BelongsToMany (many-to-many) relationships, the page for the plugin doesn't say it extends that kind of support, if it's the same as the form repeated that's still not my use case
6 replies