mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
29 lines
561 B
PHP
29 lines
561 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
|
|
class Voucher extends AbstractModel
|
|
{
|
|
protected $table = 'vouchers';
|
|
|
|
/**
|
|
* @return HasMany
|
|
*/
|
|
public function redemptions(): HasMany
|
|
{
|
|
return $this->hasMany(VoucherRedemption::class, 'voucher_id', 'id');
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo
|
|
*/
|
|
public function campaign(): BelongsTo
|
|
{
|
|
return $this->belongsTo(VoucherCampaign::class, 'voucher_campaign_id');
|
|
}
|
|
}
|