<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Prize extends Model
{
    protected $appends = ['pending'];
    public function category()
    {
        return $this->hasOne(PrizeCategory::class,"id","prize_category_id");
    }

    public function getPendingAttribute()
    {
        $pending=$this->total_count-$this->drawn_count;
        return $pending;
    }
}
