Project.php 442 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Project extends Model
  5. {
  6. public function directors()
  7. {
  8. return $this->belongsTo(Director::class, 'director_id', 'id');
  9. }
  10. public function spheres()
  11. {
  12. return $this->belongsTo(Sphere::class, 'sphere_id', 'id');
  13. }
  14. public function employees()
  15. {
  16. return $this->belongsToMany(Employee::class, 'emploee_projects');
  17. }
  18. }