ldc-mesbr-app/app/Models/BasketsContent.php
2023-12-01 15:27:30 +01:00

46 lines
1.1 KiB
PHP

<?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
*/
class BasketsContent extends Model
{
use HasFactory;
// * RELATIONS
/**
* Get the basket that owns the BasketContent
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function basket(): BelongsTo
{
return $this->belongsTo(Basket::class);
}
/**
* Get the coupon owned by the BasketContent
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function coupon(): BelongsTo
{
return $this->BelongsTo(Coupon::class);
}
}