@extends('backend.layouts.app') @section('title', __('Page Manager')) @push('styles') @endpush @push('scripts') @endpush @section('content') @php // Controller PageController::index passes all KPIs directly. The ?? // fallbacks recompute from $pages only when something upstream // (stale compiled view, regressed payload) leaves them undefined so // the hero never throws "Undefined variable" again. $totalPages = $totalPages ?? (isset($pages) ? $pages->count() : 0); $activePages = $activePages ?? (isset($pages) ? $pages->where('is_active', true)->count() : 0); $dynamicPages = $dynamicPages ?? (isset($pages) ? $pages->filter(fn ($page) => $page->type === \App\Enums\PageType::Dynamic)->count() : 0); $protectedPages = $protectedPages ?? max(0, $totalPages - $dynamicPages); $homePages = $homePages ?? (isset($pages) ? $pages->where('is_home', true)->count() : 0); $totalComponents = $totalComponents ?? (isset($pages) ? (int) $pages->sum(fn ($page) => is_array($page->component_ids) ? count($page->component_ids) : 0) : 0); @endphp
{{ __('Manage pages, routes, and publish state from one compact workspace.') }}
{{ __('Keep editable and core routes clearly separated.') }}
| {{ __('Page') }} | {{ __('Slug') }} | {{ __('Structure') }} | {{ __('Status') }} | {{ __('Action') }} |
|---|---|---|---|---|
|
{{ $page->label }}
|
{{ $pagePath }} |
{{ trans_choice('{1} :count Component|[2,*] :count Components', $componentCount, ['count' => $componentCount]) }}
$isDynamic,
'pm-structure-badge--protected' => ! $isDynamic,
])>
{{ $isDynamic ? __('Dynamic Page') : __('Core Page') }}
|
$page->is_active,
'pm-status-pill--danger' => ! $page->is_active,
])>
{{ $page->is_active ? __('Active') : __('Inactive') }}
! $isDynamic,
'pm-status-pill--neutral' => $isDynamic,
])>
{{ $isDynamic ? __('Editable') : __('Protected') }}
|
@can('page-edit')
{{ __('Manage') }}
@endcan
{{ __('SEO') }}
@if($isDynamic)
@can('page-delete')
{{ __('Delete') }}
@endcan
@else
{{ __('Protected') }}
@endif
|
|
|
||||
{{ __('No matching pages') }}{{ __('Try a different keyword for the title, slug, type, or publishing state.') }} |
||||