I have the following Models:
- Assessment
- Upload
- Grade
These are their relationships:
- Assessment hasMany Upload
- Upload belongsTo Assessment
- Upload hasOne Grade
- Grade belongsTo Upload
Tables:
- users
- assessment (id, user_id, name)
- uploads (id, assessment_id, grade_id, filename, size)
- grade (id, name)
I'm currently doing this, but want to get/show the grade name too of the upload, but not sure how?:
@foreach ($assessment->uploads as $upload)
{{ $upload }}
@endforeach