Initial commit

This commit is contained in:
2026-10-31 13:24:24 +01:00
commit e6805f2245
87 changed files with 16180 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Order extends Model
{
use HasFactory;
protected $fillable = [
'order_number',
'customer_name',
'customer_email',
'customer_phone',
'shipping_street',
'shipping_number',
'shipping_postal_code',
'shipping_city',
'shipping_country',
'notes',
'status',
'subtotal',
'shipping_cost',
'total',
'payment_status',
'payment_method',
];
protected $casts = [
'subtotal' => 'float',
'shipping_cost' => 'float',
'total' => 'float',
];
public function items(): HasMany
{
return $this->hasMany(OrderItem::class);
}
public function getFormattedTotalAttribute(): string
{
return '€ ' . number_format($this->total, 2, ',', '.');
}
}