<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;

class FileUpload extends Model
{
    use HasFactory, HasUuids;

    protected $table = 'file_uploads';
    protected $keyType = 'string';
    public $incrementing = false;

    protected $fillable = ['letter_id', 'file_name', 'file_path', 'mime_type'];

    protected static function boot()
    {
        parent::boot();
        static::creating(function ($model) {
            $model->id = Str::uuid()->toString();
        });
    }
}