<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Animal extends Model
{
    protected $fillable = [
        'cattle_category_id',
        'user_id',
        'animal_name',
        'buy_date',
        'buy_price',
        'sale_date',
        'sale_price',
        'breed',
        'weight',
        'tag_number',
        'notes',
    ];

    public function category()
    {
        return $this->belongsTo(CattleCategory::class, 'cattle_category_id');
    }

    public function images()
    {
        return $this->hasMany(AnimalImage::class);
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}