IrrecusableProposalProduct.php 940 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. /**
  7. * @property int $id
  8. * @property int $irrecusable_proposal_id
  9. * @property int $product_id
  10. * @property int $quantity
  11. * @property float $price
  12. * @property-read \App\Models\IrrecusableProposal $irrecusableProposal
  13. * @property-read \App\Models\Product $product
  14. */
  15. class IrrecusableProposalProduct extends Model
  16. {
  17. use HasFactory;
  18. protected $table = 'irrecusable_proposal_products';
  19. protected $guarded = ['id'];
  20. protected $casts = [
  21. 'quantity' => 'integer',
  22. 'price' => 'float',
  23. ];
  24. public function irrecusableProposal(): BelongsTo
  25. {
  26. return $this->belongsTo(IrrecusableProposal::class);
  27. }
  28. public function product(): BelongsTo
  29. {
  30. return $this->belongsTo(Product::class);
  31. }
  32. }