ReclamationSparePart.php 811 B

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