ldc-mesbr-app/app/Models/BasketsContent.php

47 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2023-09-13 16:48:17 +02:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* BasketContent
*
* @property integer $id BasketContent id.
* @property integer $basket_id Basket id.
* @property integer $coupon_id Coupon id.
* @property integer $qty The quantity in the basket.
*
* * RELATIONS
* @property-read \App\Models\Basket $basket The basket that owns the BasketContent
* @property-read \App\Models\Coupon $coupon The coupon owned by the BasketContent
*/
2023-09-13 16:48:17 +02:00
class BasketsContent extends Model
{
use HasFactory;
// * RELATIONS
2023-11-24 15:35:08 +01:00
/**
* Get the basket that owns the BasketContent
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function basket(): BelongsTo
2023-09-13 16:48:17 +02:00
{
return $this->belongsTo(Basket::class);
}
2023-11-24 15:35:08 +01:00
/**
* Get the coupon owned by the BasketContent
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function coupon(): BelongsTo
2023-09-13 16:48:17 +02:00
{
return $this->BelongsTo(Coupon::class);
}
}