Initial commit: WitShop Laravel Online-Shop
- Laravel 11, Blade, Alpine.js, Tailwind CSS - Produkt- & Kategorieverwaltung mit Varianten - Checkout (Vorkasse + Rechnung), Session-Warenkorb - Admin-Backend (Dashboard, Bestellungen, Kunden, CMS) - DSGVO-konform: Cookie-Consent, Impressum, Widerruf, AGB - PDF-Rechnung via dompdf, SMTP-Mailversand - Kundenverwaltung mit manueller Freischaltung Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Order;
|
||||
use Barryvdh\DomPDF\Facade\Pdf;
|
||||
|
||||
class InvoiceService
|
||||
{
|
||||
public function generate(Order $order): \Barryvdh\DomPDF\PDF
|
||||
{
|
||||
$order->load('items', 'addresses');
|
||||
return Pdf::loadView('pdf.invoice', compact('order'))
|
||||
->setPaper('a4', 'portrait');
|
||||
}
|
||||
|
||||
public function filename(Order $order): string
|
||||
{
|
||||
return 'Rechnung-' . $order->order_number . '.pdf';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user