- Tenant-Admin-PWA: Neues /event-admin/welcome Onboarding mit WelcomeHero, Packages-, Order-Summary- und Event-Setup-Pages, Zustandsspeicher, Routing-Guard und Dashboard-CTA für Erstnutzer; Filament-/admin-Login via Custom-View behoben.
- Brand/Theming: Marketing-Farb- und Typographievariablen in `resources/css/app.css` eingeführt, AdminLayout, Dashboardkarten und Onboarding-Komponenten entsprechend angepasst; Dokumentation (`docs/todo/tenant-admin-onboarding-fusion.md`, `docs/changes/...`) aktualisiert. - Checkout & Payments: Checkout-, PayPal-Controller und Tests für integrierte Stripe/PayPal-Flows sowie Paket-Billing-Abläufe überarbeitet; neue PayPal SDK-Factory und Admin-API-Helper (`resources/js/admin/api.ts`) schaffen Grundlage für Billing/Members/Tasks-Seiten. - DX & Tests: Neue Playwright/E2E-Struktur (docs/testing/e2e.md, `tests/e2e/tenant-onboarding-flow.test.ts`, Utilities), E2E-Tenant-Seeder und zusätzliche Übersetzungen/Factories zur Unterstützung der neuen Flows. - Marketing-Kommunikation: Automatische Kontakt-Bestätigungsmail (`ContactConfirmation` + Blade-Template) implementiert; Guest-PWA unter `/event` erreichbar. - Nebensitzung: Blogsystem gefixt und umfassenden BlogPostSeeder für Beispielinhalte angelegt.
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Mail\ContactConfirmation;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Stripe\Stripe;
|
||||
use Stripe\Checkout\Session;
|
||||
@@ -24,6 +25,7 @@ use App\Models\TenantPackage;
|
||||
use App\Models\PackagePurchase;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Inertia\Inertia;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
class MarketingController extends Controller
|
||||
{
|
||||
@@ -362,6 +364,7 @@ class MarketingController extends Controller
|
||||
]);
|
||||
|
||||
$query = BlogPost::query()
|
||||
->with('author')
|
||||
->whereHas('category', function ($query) {
|
||||
$query->where('slug', 'blog');
|
||||
});
|
||||
@@ -376,7 +379,7 @@ class MarketingController extends Controller
|
||||
$totalPublished = $query->count();
|
||||
Log::info('Blog Index Debug - Published', ['count' => $totalPublished]);
|
||||
|
||||
$query->whereJsonContains("translations->locale->title->{$locale}", true);
|
||||
// Removed translation filter for now
|
||||
|
||||
$totalWithTranslation = $query->count();
|
||||
Log::info('Blog Index Debug - With Translation', ['count' => $totalWithTranslation, 'locale' => $locale]);
|
||||
@@ -384,7 +387,21 @@ class MarketingController extends Controller
|
||||
$posts = $query->orderBy('published_at', 'desc')
|
||||
->paginate(8);
|
||||
|
||||
Log::info('Blog Index Debug - Final Posts', ['count' => $posts->count(), 'total' => $posts->total()]);
|
||||
// Transform posts to include translated strings for the current locale
|
||||
$posts->getCollection()->transform(function ($post) use ($locale) {
|
||||
$post->title = $post->getTranslation('title', $locale) ?? $post->getTranslation('title', 'de') ?? '';
|
||||
$post->excerpt = $post->getTranslation('excerpt', $locale) ?? $post->getTranslation('excerpt', 'de') ?? '';
|
||||
$post->content = $post->getTranslation('content', $locale) ?? $post->getTranslation('content', 'de') ?? '';
|
||||
// Author name is a string, no translation needed; author is loaded via with('author')
|
||||
return $post;
|
||||
});
|
||||
|
||||
Log::info('Blog Index Debug - Final Posts', [
|
||||
'count' => $posts->count(),
|
||||
'total' => $posts->total(),
|
||||
'posts_data' => $posts->toArray(),
|
||||
'first_post_title' => $posts->count() > 0 ? $posts->first()->title : 'No posts'
|
||||
]);
|
||||
|
||||
return Inertia::render('marketing/Blog', compact('posts'));
|
||||
}
|
||||
@@ -392,7 +409,8 @@ class MarketingController extends Controller
|
||||
public function blogShow($slug)
|
||||
{
|
||||
$locale = app()->getLocale();
|
||||
$post = BlogPost::query()
|
||||
$postModel = BlogPost::query()
|
||||
->with('author')
|
||||
->whereHas('category', function ($query) {
|
||||
$query->where('slug', 'blog');
|
||||
})
|
||||
@@ -400,9 +418,43 @@ class MarketingController extends Controller
|
||||
->where('is_published', true)
|
||||
->whereNotNull('published_at')
|
||||
->where('published_at', '<=', now())
|
||||
->whereJsonContains("translations->locale->title->{$locale}", true)
|
||||
// Removed translation filter for now
|
||||
->firstOrFail();
|
||||
|
||||
// Transform to array with translated strings for the current locale
|
||||
$markdown = $postModel->getTranslation('content', $locale) ?? $postModel->getTranslation('content', 'de') ?? '';
|
||||
$converter = new \League\CommonMark\CommonMarkConverter();
|
||||
$contentHtml = (string) $converter->convert($markdown);
|
||||
|
||||
// Debug log for content_html
|
||||
\Log::info('BlogShow Debug: content_html type and preview', [
|
||||
'type' => gettype($contentHtml),
|
||||
'is_string' => is_string($contentHtml),
|
||||
'length' => strlen($contentHtml ?? ''),
|
||||
'preview' => substr((string)$contentHtml, 0, 200) . '...'
|
||||
]);
|
||||
|
||||
$post = [
|
||||
'id' => $postModel->id,
|
||||
'title' => $postModel->getTranslation('title', $locale) ?? $postModel->getTranslation('title', 'de') ?? '',
|
||||
'excerpt' => $postModel->getTranslation('excerpt', $locale) ?? $postModel->getTranslation('excerpt', 'de') ?? '',
|
||||
'content' => $markdown,
|
||||
'content_html' => $contentHtml,
|
||||
'featured_image' => $postModel->featured_image ?? $postModel->banner_url ?? null,
|
||||
'published_at' => $postModel->published_at->toDateString(),
|
||||
'slug' => $postModel->slug,
|
||||
'author' => $postModel->author ? [
|
||||
'name' => $postModel->author->name
|
||||
] : null,
|
||||
];
|
||||
|
||||
// Debug log for final postArray
|
||||
\Log::info('BlogShow Debug: Final post content_html', [
|
||||
'type' => gettype($post['content_html']),
|
||||
'is_string' => is_string($post['content_html']),
|
||||
'length' => strlen($post['content_html'] ?? ''),
|
||||
]);
|
||||
|
||||
return Inertia::render('marketing/BlogShow', compact('post'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user