SparePartOrderShipment.php 771 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  5. class SparePartOrderShipment extends Model
  6. {
  7. protected $fillable = [
  8. 'spare_part_order_id',
  9. 'quantity',
  10. 'note',
  11. 'reclamation_id',
  12. 'user_id',
  13. 'is_automatic',
  14. ];
  15. protected $casts = [
  16. 'is_automatic' => 'boolean',
  17. 'quantity' => 'integer',
  18. ];
  19. public function sparePartOrder(): BelongsTo
  20. {
  21. return $this->belongsTo(SparePartOrder::class);
  22. }
  23. public function reclamation(): BelongsTo
  24. {
  25. return $this->belongsTo(Reclamation::class);
  26. }
  27. public function user(): BelongsTo
  28. {
  29. return $this->belongsTo(User::class);
  30. }
  31. }