StudentProposal.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class StudentProposal extends Model
  5. {
  6. public function teacher_details(){
  7. return $this->belongsTo(User::class,'teacher_id');
  8. }
  9. public function student_details(){
  10. return $this->belongsTo(User::class,'student_id');
  11. }
  12. public function institutes()
  13. {
  14. return $this->belongsTo(Institution::class, 'student_id','student_id');
  15. }
  16. public function scores()
  17. {
  18. return $this->belongsTo(Score::class, 'student_id','student_id');
  19. }
  20. public function work_experience()
  21. {
  22. return $this->belongsTo(Workexperience::class, 'student_id','student_id');
  23. }
  24. public function proposal()
  25. {
  26. return $this->belongsTo(Proposal::class, 'proposal_id','id');
  27. }
  28. public function work_experience_date()
  29. {
  30. return $this->hasMany(Workexperience::class, 'student_id','student_id');
  31. }
  32. public function country_name()
  33. {
  34. return $this->belongsTo(Country::class, 'nationality', 'id');
  35. }
  36. public function publications()
  37. {
  38. return $this->hasMany('App\Models\Publication', 'student_id','student_id');
  39. }
  40. }