<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Evidence extends Model
{
    use HasFactory, SoftDeletes;
    protected $fillable = ['case_id','uploaded_by','type','title','description','source','visibility','file_name','file_path','mime_type','extension','file_size','sha256_hash','captured_at'];
    public function caseFile(): BelongsTo { return $this->belongsTo(CaseFile::class, 'case_id'); }
    public function uploader(): BelongsTo { return $this->belongsTo(User::class, 'uploaded_by'); }
    public function custodyEvents(): HasMany { return $this->hasMany(EvidenceCustodyEvent::class, 'evidence_id'); }
}
