Initial commit: Import existing Laravel project

This commit is contained in:
jeremy bayse
2026-06-15 08:12:33 +02:00
parent 7420d1b466
commit 030d76af53
143 changed files with 21885 additions and 1 deletions

35
app/Models/Attachment.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
class Attachment extends Model
{
protected $fillable = [
'order_id',
'file_path',
'file_name',
'file_type',
];
protected $appends = ['url'];
/**
* Relation avec la commande.
*/
public function order()
{
return $this->belongsTo(Order::class);
}
/**
* Accesseur pour obtenir l'URL de téléchargement sécurisée.
*/
public function getUrlAttribute()
{
return route('attachments.show', $this->id);
}
}