Schedule.php 914 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Models;
  3. use App\Models\Dictionary\Area;
  4. use App\Models\Dictionary\District;
  5. use Illuminate\Database\Eloquent\Model;
  6. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  7. class Schedule extends Model
  8. {
  9. protected $fillable = [
  10. 'installation_date',
  11. 'address_code',
  12. 'manual',
  13. 'source',
  14. 'order_id',
  15. 'district_id',
  16. 'area_id',
  17. 'object_address',
  18. 'object_type',
  19. 'mafs',
  20. 'mafs_count',
  21. 'brigadier_id',
  22. 'comment',
  23. 'transport',
  24. 'admin_comment',
  25. ];
  26. public function district(): BelongsTo
  27. {
  28. return $this->belongsTo(District::class);
  29. }
  30. public function area(): BelongsTo
  31. {
  32. return $this->belongsTo(Area::class);
  33. }
  34. public function brigadier(): BelongsTo
  35. {
  36. return $this->belongsTo(User::class, 'brigadier_id', 'id');
  37. }
  38. }