NASER aff gift card controller and models and routes

This commit is contained in:
gholak tala
2026-05-01 19:34:10 +00:00
parent e595249ba7
commit 562edfadd9
5 changed files with 294 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\Customer;
class GiftCardCodes extends Model
{
use HasFactory;
protected $table = 'giftcard_codes';
protected $fillable = [
'giftcard_id',
'code',
'sts',
'unit',
'amount',
'assigned_to',
'used_at',
'expiry_date',
];
static $STS = [
1=>'فعال',
2=>'استفاده شده',
3=>'منقضی شده'
];
static $UNIT = [
1=>'IRR',
2=>'Golden'
];
public function assignedTo()
{
return $this->belongsTo(Customer::class, 'assigned_to', 'id')->select('id', 'name', 'mobile');
}
}