Files
WitShop/app/Http/Controllers/Shop/PageController.php
T
marcoandClaude Sonnet 4.6 41078fdc08 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>
2026-06-20 00:34:09 +02:00

28 lines
763 B
PHP

<?php
namespace App\Http\Controllers\Shop;
use App\Http\Controllers\Controller;
use App\Models\Page;
class PageController extends Controller
{
public function show(string $slug)
{
$page = Page::where('slug', $slug)->where('published', true)->firstOrFail();
return view('shop.page', compact('page'));
}
public function blog()
{
$posts = Page::where('type', 'blog')->where('published', true)->latest('published_at')->paginate(10);
return view('shop.blog.index', compact('posts'));
}
public function blogPost(string $slug)
{
$post = Page::where('slug', $slug)->where('type', 'blog')->where('published', true)->firstOrFail();
return view('shop.blog.post', compact('post'));
}
}