<?php

namespace App\Models;

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

class GiftCards 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;

        });
    }
    public function giftCardAmount(){
        return $this->hasMany(GiftCardAmount::class, 'card_id','id');
    }
}
