change gift-card

This commit is contained in:
2026-09-21 11:09:40 +03:30
parent ba2ac5aefe
commit 698fbed805
4 changed files with 105 additions and 20 deletions
+7
View File
@@ -4,6 +4,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\Customer;
use App\Models\GiftCardCodes;
class GiftCard extends Model
@@ -15,6 +16,7 @@ class GiftCard extends Model
protected $fillable = [
'customer_id',
'use_once',
'show_in_app',
'count',
'amount',
'total',
@@ -33,6 +35,11 @@ class GiftCard extends Model
return $this->hasMany(GiftCardCodes::class, 'giftcard_id', 'id');
}
public function customer()
{
return $this->belongsTo(Customer::class, 'customer_id', 'id')->select('id', 'name', 'mobile');
}
static $STS = [
1 => "فعال",
2 => "تمام شده",