jeudi 25 janvier 2018

How to handle mutators and relationships?

I have a bunch of users who will have dates that they will be missing class. I currently have a table that outputs attendance percentages. It counts all the absences a user has and compares that to the number of classes for that user, and outputs a percentage.

I want to do this exact same thing, but limit the attendance percentage for all classes/absences after a certain date. I'm not sure what the best way to do this would be in Laravel.

Technically speaking, I have a users class and controller, an absence class/controller, and they are related via a hasMany/BelongstoMany relationship.

Any advice would be appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire