暫無描述

Student.php 464B

123456789101112131415161718192021
  1. <?php
  2. class Student extends Eloquent
  3. {
  4. protected $fillable = array('name', 'number', 'email', 'school_code', 'conc_code');
  5. public function courses()
  6. {
  7. return $this->belongsToMany('Course')->withTimestamps();
  8. }
  9. public function program()
  10. {
  11. return $this->belongsTo('Program');
  12. }
  13. public function assessed_activities()
  14. {
  15. return $this->belongsToMany('Activity', 'assessments')->withPivot('scores', 'percentage')->withTimestamps();
  16. }
  17. }