RepairDevice.php 749 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. class RepairDevice extends BaseModel
  6. {
  7. use SoftDeletes;
  8. public function parts()
  9. {
  10. return $this->hasMany('App\Models\Part', 'repair_device_id');
  11. }
  12. public function user()
  13. {
  14. return $this->belongsTo('App\Models\User', 'user_id');
  15. }
  16. public function project()
  17. {
  18. return $this->belongsTo('App\Models\Project', 'project_id');
  19. }
  20. public function inner_device()
  21. {
  22. return $this->belongsTo('App\Models\InnerDevice', 'inner_device_id');
  23. }
  24. public function work_point()
  25. {
  26. return $this->belongsTo('App\Models\WorkPoint', 'work_point_id');
  27. }
  28. }