Update Table Data from Form Select Options

Hello everyone, I'm working on a school attendance application using Filament, and I'm having trouble figuring out how to update table data from form select options. Specifically, I need to create a form that allows the user to select a class and a stream, and then generates a table containing the students in that particular stream. The user should then be able to mark each student as present or absent, and submit the attendance data to update the table. I'm having trouble understanding how to set up the getTableQuery() function in Filament to retrieve the students from the database based on the selected class and stream, and how to update the attendance data in the table once it has been submitted. Any suggestions or guidance on how to achieve this functionality would be greatly appreciated. Thank you in advance for your help!
14 Replies
wyChoong
wyChoong2y ago
Filament
Filters - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.
wyChoong
wyChoong2y ago
Filament
Actions - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.
ianclemence
ianclemenceOP2y ago
@wychoong thanks for the reply. Is it possible to have dependent SeletFilters? Such that, when a user selects a particular class he/she should be able to select streams associated with that class only
wyChoong
wyChoong2y ago
Pretty sure you can find that by using the search on the site
wyChoong
wyChoong2y ago
Filament
Fields - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
ianclemence
ianclemenceOP2y ago
How do I capture a table fielter (in my case, DatePicker) and pass it to an action function. I'm trying to save the attendance data but I cannot insert the data without the attendance date
Dan Harrin
Dan Harrin2y ago
probably $livewire->tableFilters array
ianclemence
ianclemenceOP2y ago
I have tried capturing the filters array but i get "Cannot access protected property Filament\Tables\Filters\Filter:: ..." error
LeandroFerreira
Can you share the code please?
ianclemence
ianclemenceOP2y ago
The first screenshot shows the table filters function while the second one is for the "mark_as_present" bulk action where i'm trying to capture the "date_of_attendance" filter
LeandroFerreira
$filters = $this->tableFilters;
$filters = $this->tableFilters;
?
ianclemence
ianclemenceOP2y ago
It worked. Thank you! I thought so too but it seems like the issue is there are some methods present in the dependent Select form field that aren't in the SelelctFilter.
black ka1ser
black ka1ser2y ago
hi is it possible to have a look at ur repo? cs im helping my friend to develop a filament-based cocurricular attendance system
black ka1ser
black ka1ser2y ago
currently thinking for ideas to set the attendance for each students
Want results from more Discord servers?
Add your server