{{--
Beispiel: Verwendung des CategoryService in einer Einzelkategorie-Seite
Pfad: resources/views/web/kategorie.blade.php
--}}
@extends('web.layouts.web-master')
@section('title', 'Kategorie - Business Portal 24')
@section('content')
@php
use App\Services\CategoryService;
// Kategorie aus Route-Parameter laden
$slug = request()->segment(2); // z.B. 'wirtschaft'
$category = CategoryService::getCategoryBySlug($slug);
// Wenn Kategorie nicht gefunden, 404
if (!$category) {
abort(404);
}
// Alle Kategorien für Navigation
$allCategories = CategoryService::getCategories();
// Icon- und Farb-Informationen
$iconPath = CategoryService::getIconPath($category['icon']);
$gradient = CategoryService::getGradientForColor($category['color']);
$iconColor = CategoryService::getClassForColor($category['color']);
@endphp