FantonioMotta
FantonioMotta
FFilament
Created by FantonioMotta on 4/3/2024 in #❓┊help
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
1 replies
FFilament
Created by FantonioMotta on 1/12/2024 in #❓┊help
Bringing and Saving Previous Selections When Editing Page with 'Select' Field
Hello good afternoon, I needed help On one of my screens I have a Select field where your options are specific through a database query Select::make('discipline') ->multiple() ->options(function (callable $get){ $disciplines = Curso::select('tb_disciplina.id_disciplina', 'tb_disciplina.descricao') ->join('tb_periodo', 'tb_curso.id_curso', 'tb_periodo.id_curso') ->join('tb_disciplina', 'tb_periodo.id_periodo', 'tb_disciplina.id_periodo') ->where('tb_curso.id_curso', $get('id_curso')) ->where('tb_curso.status', 'Ativo') ->orderBy('tb_periodo.nome'); return $disciplinas->pluck('tb_disciplina.descricao', 'tb_disciplina.id_disciplina'); }) When subjects are selected, it saves this information in another table in the bank. What do I need to know and when I edit the page, how do I bring what was previously selected and save it in the other table
2 replies
FFilament
Created by FantonioMotta on 1/11/2024 in #❓┊help
Bringing and Saving Previous Selections When Editing Page with 'Select' Field
Hello good afternoon, I needed help On one of my screens I have a Select field where your options are specific through a database query
Select::make('discipline') ->multiple() ->options(function (callable $get){ $disciplines = Curso::select('tb_disciplina.id_disciplina', 'tb_disciplina.descricao') ->join('tb_periodo', 'tb_curso.id_curso', 'tb_periodo.id_curso') ->join('tb_disciplina', 'tb_periodo.id_periodo', 'tb_disciplina.id_periodo') ->where('tb_curso.id_curso', $get('id_curso')) ->where('tb_curso.status', 'Ativo') ->orderBy('tb_periodo.nome'); return $disciplinas->pluck('tb_disciplina.descricao', 'tb_disciplina.id_disciplina'); })
When subjects are selected, it saves this information in another table in the bank. What do I need to know and when I edit the page, how do I bring what was previously selected and save it in the other table
1 replies
FFilament
Created by FantonioMotta on 10/11/2023 in #❓┊help
Sub-navigation menu
Hello Guys, I'm looking for a good way to have sub-navigation menu This is what i'm looking for :
Menu Grup01 Item01 Item02 Grup02 Item01 Item02 Menu ......
Can you tell me if there is any way to do this in V2.0?
5 replies
FFilament
Created by FantonioMotta on 8/7/2023 in #❓┊help
Query an item in a table in the Database and insert one in the front column
Hello good afternoon I needed to know if there is any way in the Resources of FilamentPHP to query an item from a table in the Database in the case of Item Code in Stock (PAT), if you have this item in the table mark it as "OK" in the Status column Att.
3 replies
FFilament
Created by FantonioMotta on 6/15/2023 in #❓┊help
Integrating Custom Pages into Laravel Policies
I'm doing a project where I had to use the custom pages functionality, but with these pages I'm not getting the access permissions configured in app/Providers
6 replies