<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class EggCollection extends Model
{
    use HasFactory, SoftDeletes;

    protected $guarded = ['id'];

    protected function casts(): array
    {
        return [
            'production_date' => 'datetime',
            'total_eggs' => 'integer',
        ];
    }

    public function items(): HasMany
    {
        return $this->hasMany(EggCollectionItem::class);
    }
}
