© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago
FantonioMotta

Group resource list without model ID

I'm trying to create a page that will bring the records of Student Certificates from the group grouped by Id_student, where I will have a second screen later on that will list the certificates of a specific student selected, but in this case, when I do the Group By, it will return this to me. error "SQLSTATE[42000]: Syntax error or access violation: 1055 'dash_unidesco.mc_certificado_aluno.id_aluno_certificado' isn't in GROUP BY", how can I do this group by?

In model "CertificadoAluno" the id would be id_certificado_aluno
in Group By I am using another field

class CertificadoAlunoResource extends Resource
{
protected static ?string $model = CertificadoAluno::class;

protected static ?string $navigationIcon = 'heroicon-o-collection';

protected static ?string $navigationGroup = 'Micro Certificado';

protected static ?string $navigationLabel = 'Certificado Alunos';

protected static ?string $label = 'Controle de Certificado Alunos';

public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->select('*')->groupBY('id_aluno');
}

...
}

If you need more information, just ask
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

File Upload without model/resource
FilamentFFilament / ❓┊help
2y ago
Output a list/table in Resource's view-page without any Model
FilamentFFilament / ❓┊help
2y ago
Edit Resource model
FilamentFFilament / ❓┊help
3y ago