rearranged tenant admin layout, invite layouts now visible and manageable
This commit is contained in:
@@ -39,10 +39,26 @@ class EventController extends Controller
|
||||
$query = Event::where('tenant_id', $tenantId)
|
||||
->with([
|
||||
'eventType',
|
||||
'photos',
|
||||
'eventPackages.package',
|
||||
'eventPackage.package',
|
||||
])
|
||||
->withCount([
|
||||
'photos',
|
||||
'photos as pending_photos_count' => fn ($photoQuery) => $photoQuery->where('status', 'pending'),
|
||||
'tasks as tasks_count',
|
||||
'joinTokens as total_join_tokens_count',
|
||||
'joinTokens as active_join_tokens_count' => fn ($tokenQuery) => $tokenQuery
|
||||
->whereNull('revoked_at')
|
||||
->where(function ($query) {
|
||||
$query->whereNull('expires_at')
|
||||
->orWhere('expires_at', '>', now());
|
||||
})
|
||||
->where(function ($query) {
|
||||
$query->whereNull('usage_limit')
|
||||
->orWhereColumn('usage_limit', '>', 'usage_count');
|
||||
}),
|
||||
])
|
||||
->withSum('photos as likes_sum', 'likes_count')
|
||||
->orderBy('created_at', 'desc');
|
||||
|
||||
if ($request->has('status')) {
|
||||
|
||||
@@ -265,14 +265,6 @@ class MarketingController extends Controller
|
||||
$converter = new MarkdownConverter($environment);
|
||||
$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') ?? '',
|
||||
@@ -287,13 +279,6 @@ class MarketingController extends Controller
|
||||
] : 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'));
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ class EventJoinTokenResource extends JsonResource
|
||||
$eventContext = $eventFromRoute instanceof Event ? $eventFromRoute : ($this->resource->event ?? null);
|
||||
|
||||
$layouts = [];
|
||||
if ($eventContext && Route::has('tenant.events.join-tokens.layouts.download')) {
|
||||
if ($eventContext && Route::has('api.v1.tenant.events.join-tokens.layouts.download')) {
|
||||
$layouts = JoinTokenLayoutRegistry::toResponse(function (string $layoutId, string $format) use ($eventContext) {
|
||||
return route('tenant.events.join-tokens.layouts.download', [
|
||||
return route('api.v1.tenant.events.join-tokens.layouts.download', [
|
||||
'event' => $eventContext,
|
||||
'joinToken' => $this->resource,
|
||||
'joinToken' => $eventContext instanceof Event ? $this->resource->id : $this->resource,
|
||||
'layout' => $layoutId,
|
||||
'format' => $format,
|
||||
]);
|
||||
@@ -32,10 +32,10 @@ class EventJoinTokenResource extends JsonResource
|
||||
}
|
||||
|
||||
$layoutsUrl = null;
|
||||
if ($eventContext && Route::has('tenant.events.join-tokens.layouts.index')) {
|
||||
$layoutsUrl = route('tenant.events.join-tokens.layouts.index', [
|
||||
if ($eventContext && Route::has('api.v1.tenant.events.join-tokens.layouts.index')) {
|
||||
$layoutsUrl = route('api.v1.tenant.events.join-tokens.layouts.index', [
|
||||
'event' => $eventContext,
|
||||
'joinToken' => $this->resource,
|
||||
'joinToken' => $eventContext instanceof Event ? $this->resource->id : $this->resource,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,8 +49,14 @@ class EventResource extends JsonResource
|
||||
'event_type_id' => $this->event_type_id,
|
||||
'created_at' => $this->created_at?->toISOString(),
|
||||
'updated_at' => $this->updated_at?->toISOString(),
|
||||
'photo_count' => $this->photos_count ?? 0,
|
||||
'like_count' => $this->whenLoaded('photos', fn () => $this->photos->sum('likes_count'), 0),
|
||||
'photo_count' => (int) ($this->photos_count ?? 0),
|
||||
'pending_photo_count' => isset($this->pending_photos_count) ? (int) $this->pending_photos_count : null,
|
||||
'like_count' => isset($this->likes_sum)
|
||||
? (int) $this->likes_sum
|
||||
: $this->whenLoaded('photos', fn () => (int) $this->photos->sum('likes_count'), 0),
|
||||
'tasks_count' => isset($this->tasks_count) ? (int) $this->tasks_count : null,
|
||||
'active_invites_count' => isset($this->active_join_tokens_count) ? (int) $this->active_join_tokens_count : null,
|
||||
'total_invites_count' => isset($this->total_join_tokens_count) ? (int) $this->total_join_tokens_count : null,
|
||||
'is_public' => $this->status === 'published',
|
||||
'public_share_url' => null,
|
||||
'qr_code_url' => null,
|
||||
|
||||
Reference in New Issue
Block a user