Create pivot table in laravel to display attendance

I am creating an application in laravel for entering attendance. My attendance table name is attendance_tbl . This table contains following columns,
id, stud_id, class_id, attn_date, attendance, created_at, updated_at, updated_by

the attendance column value is 0 for absent and 1 for present.

I want to display consolidated attendance of a week or month as per following requirements. I want rowname as studentname and columnname as Date and cloumnname below attendance.

There is a table named students contains following fields,
id, user_id, student_name, class_id, updated_by, updated_at, created_at

How will I solve this problem??

Source: laravel

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.