Teacher.php 341 B

1234567891011121314151617
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Foundation\Auth\User as Authenticatable;
  4. class Teacher extends Authenticatable
  5. {
  6. protected $table = 'teachers';
  7. protected $guarded = [];
  8. public function courses()
  9. {
  10. return $this->belongsToMany('App\Models\Course', 'teacher_courses', 'teacher_id', 'course_id');
  11. }
  12. }