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
Filament
Filters - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.
Filament
Actions - Table Builder - Filament
The elegant TALL stack table builder for Laravel artisans.
@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
Pretty sure you can find that by using the search on the site
https://filamentphp.com/docs/2.x/forms/fields#dependant-selects
The concept will be similar
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
probably $livewire->tableFilters array
I have tried capturing the filters array but i get "Cannot access protected property Filament\Tables\Filters\Filter:: ..." error
Can you share the code please?
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
?
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.
hi is it possible to have a look at ur repo? cs im helping my friend to develop a filament-based cocurricular attendance system
currently thinking for ideas to set the attendance for each students