<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Voting extends Model
{
    protected $fillable = ['school_id', 'title', 'description', 'type', 'is_secret', 'starts_at', 'ends_at', 'status', 'created_by', 'published_by', 'published_at', 'closed_at'];

    protected function casts(): array
    {
        return ['is_secret' => 'boolean', 'starts_at' => 'datetime', 'ends_at' => 'datetime', 'published_at' => 'datetime', 'closed_at' => 'datetime'];
    }
}
