暫無描述

Student.php 566B

12345678910111213141516171819202122
  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. return $this->belongsToMany('Activity', 'assessments')->withPivot('scores')->withTimestamps();
  17. }
  18. }