Files
Additional/app/Models/CustomOrderFile.php
T
2025-12-29 14:43:24 +02:00

36 lines
719 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class CustomOrderFile extends Model
{
protected $fillable = [
'custom_order_id',
'file_type',
'file_path',
'original_filename',
'file_size',
'mime_type',
'uploaded_by',
];
/**
* Get the custom order that owns this file
*/
public function customOrder(): BelongsTo
{
return $this->belongsTo(CustomOrder::class);
}
/**
* Get the user who uploaded this file
*/
public function uploadedByUser(): BelongsTo
{
return $this->belongsTo(User::class, 'uploaded_by');
}
}