F
Filament6mo ago
Daniel

How to display database record with a text field or radio button beside each record, for attendance

Please how do I display record from the database with a text field or radio button beside each record so I can use it for attendance marking.
4 Replies
Daniel
Daniel6mo ago
Thank you so much @DrByte but please can I get a help on how this can be submitted as a new record to a table in the database
DrByte
DrByte6mo ago
Oh. Those examples are for a table of records, where the record behind it is updated in-real-time when clicking. But that's for "existing" data. But, you could simply create a model of attendance records, and whenever someone clicks New Attendance it opens a form that lists all the Attendees, with a checkbox or toggle box next to them. And when they click Save it stores the checked boxes. And you could create a relationship where the "form"'s checkboxes come from the Students relationship for the class/event you're taking attendance for. Probably best to simply store a list of students who "attended", and skip the records for students who did not attend (unless you have a specific need for storing a "false" for certain students). I don't see this as much of a "Filament" challenge, but just an app design challenge. Filament just helps provide a simple UI to manage the data.
Daniel
Daniel4mo ago
I have tried using filter() to filter record in laravel but i get an error of BadMethodCallException Call to undefined method Illuminate\Database\Eloquent\Builder::filter() Below is the code: public function index(){ return view('homeview', [ 'job_listings' => Latestjobs::latest()->filter(request((['search'])))->get() ]); } Please can anyone know what is the problem here?