Course.php 791 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Course extends Model
  5. {
  6. protected $table = "courses";
  7. public function destination(){
  8. return $this->belongsTo('App\Models\Destination','destination_id','id');
  9. }
  10. public function institute(){
  11. return $this->belongsTo('App\Models\Institute','institute_id','id');
  12. }
  13. public function level(){
  14. return $this->belongsTo('App\Models\Level','level_id','id');
  15. }
  16. public function campuses(){
  17. return $this->hasMany('App\Models\CourseCampus','course_id');
  18. }
  19. public function tags(){
  20. return $this->hasMany('App\Models\CourseTag','course_id');
  21. }
  22. public function intakes(){
  23. return $this->hasMany('App\Models\CourseIntake','course_id');
  24. }
  25. }