<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class GiftCardAmount extends Model
{
    use HasFactory;
    protected static function booted()
    {
        static::creating(function ($model) {
            $model->created_by = admin()->id;
        });

        static::updating(function ($model) {
            $model->updated_by = admin()->id;
        });
    }
protected $fillable=[

    'amount',
    'rate',
    'refer_bonus'
];
    public function giftCard(){
        return $this->belongsTo(GiftCards::class,'card_id')->withDefault();
    }
}
