<?php

namespace App\Models;

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

class PrizeWeek extends Model
{
    public function getActiveStatusAttribute()
    {
        $active_status=0;
        $winners=Winner::where('prize_week_id',$this->id)->count();
        $settings=Setting::where('prize_week_id',$this->id)->count();
        if($winners>0 || $settings>0){
        $active_status=1;
        }
        return $active_status;
    }
}
