1234567891011121314151617181920212223 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- class Project extends Model
- {
- public function directors()
- {
- return $this->belongsTo(Director::class, 'director_id', 'id');
- }
- public function spheres()
- {
- return $this->belongsTo(Sphere::class, 'sphere_id', 'id');
- }
- public function employees()
- {
- return $this->belongsToMany(Employee::class, 'emploee_projects');
- }
- }
|