Add Hub service layer and admin navigation restructure
Introduce Core\Service\Admin\Boot as the service definition for the Hub admin panel. Update changelog to document TASK-005 Hades admin navigation audit including new menu structure and AdminMenuProvider interface. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
71c0805bfd
commit
17bb2c8dbf
4 changed files with 1458 additions and 80 deletions
74
Service/Boot.php
Normal file
74
Service/Boot.php
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Core\Service\Admin;
|
||||||
|
|
||||||
|
use Core\Service\Contracts\ServiceDefinition;
|
||||||
|
use Core\Service\ServiceVersion;
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hub Service
|
||||||
|
*
|
||||||
|
* Core admin panel service layer.
|
||||||
|
* Uses Core\Admin as the engine.
|
||||||
|
*
|
||||||
|
* This is an internal service that powers the admin panel itself.
|
||||||
|
* It is not publicly marketed and all users implicitly have access.
|
||||||
|
*/
|
||||||
|
class Boot extends ServiceProvider implements ServiceDefinition
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get the service definition for seeding platform_services.
|
||||||
|
*/
|
||||||
|
public static function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'code' => 'hub',
|
||||||
|
'module' => 'Hub',
|
||||||
|
'name' => 'Hub',
|
||||||
|
'tagline' => 'Admin dashboard',
|
||||||
|
'description' => 'Central admin panel for managing all Host services.',
|
||||||
|
'icon' => 'house',
|
||||||
|
'color' => 'slate',
|
||||||
|
'marketing_domain' => null, // Internal service, no marketing site
|
||||||
|
'website_class' => null,
|
||||||
|
'entitlement_code' => 'core.srv.hub',
|
||||||
|
'sort_order' => 0, // First in list (internal)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin menu items for this service.
|
||||||
|
*
|
||||||
|
* Hub doesn't register menu items - it IS the menu.
|
||||||
|
*/
|
||||||
|
public function adminMenuItems(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function menuPermissions(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function canViewMenu(?object $user, ?object $workspace): bool
|
||||||
|
{
|
||||||
|
return $user !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function version(): ServiceVersion
|
||||||
|
{
|
||||||
|
return new ServiceVersion(1, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hub has no external service dependencies.
|
||||||
|
*/
|
||||||
|
public static function dependencies(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
1319
changelog/2026/jan/TASK-005-hades-admin-navigation-audit.md
Normal file
1319
changelog/2026/jan/TASK-005-hades-admin-navigation-audit.md
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -2,69 +2,48 @@
|
||||||
|
|
||||||
## Features Implemented
|
## Features Implemented
|
||||||
|
|
||||||
### Form Authorization Components
|
### Hades Admin Navigation Audit (TASK-005)
|
||||||
|
|
||||||
Authorization-aware form components that automatically disable/hide based on permissions.
|
Complete reorganisation of admin panel navigation.
|
||||||
|
|
||||||
**Files:**
|
**Structure:**
|
||||||
- `src/Forms/Concerns/HasAuthorizationProps.php` - Authorization trait
|
|
||||||
- `src/Forms/View/Components/` - Input, Textarea, Select, Checkbox, Button, Toggle, FormGroup
|
|
||||||
- `resources/views/components/forms/` - Blade templates
|
|
||||||
|
|
||||||
**Components:**
|
|
||||||
- `<x-core-forms.input />` - Text input with label, helper, error
|
|
||||||
- `<x-core-forms.textarea />` - Textarea with auto-resize
|
|
||||||
- `<x-core-forms.select />` - Dropdown with grouped options
|
|
||||||
- `<x-core-forms.checkbox />` - Checkbox with description
|
|
||||||
- `<x-core-forms.button />` - Button with variants, loading state
|
|
||||||
- `<x-core-forms.toggle />` - Toggle with instant save
|
|
||||||
- `<x-core-forms.form-group />` - Wrapper for spacing
|
|
||||||
|
|
||||||
**Usage:**
|
|
||||||
```blade
|
|
||||||
<x-core-forms.input
|
|
||||||
id="name"
|
|
||||||
label="Name"
|
|
||||||
canGate="update"
|
|
||||||
:canResource="$model"
|
|
||||||
wire:model="name"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<x-core-forms.button variant="danger" canGate="delete" :canResource="$model" canHide>
|
|
||||||
Delete
|
|
||||||
</x-core-forms.button>
|
|
||||||
```
|
```
|
||||||
|
Dashboard
|
||||||
|
├── Services (per-product sections)
|
||||||
|
│ ├── BioHost
|
||||||
|
│ ├── SocialHost
|
||||||
|
│ ├── AnalyticsHost
|
||||||
|
│ ├── NotifyHost
|
||||||
|
│ ├── TrustHost
|
||||||
|
│ └── SupportHost
|
||||||
|
├── Commerce
|
||||||
|
│ ├── Subscriptions
|
||||||
|
│ ├── Orders
|
||||||
|
│ └── Coupons
|
||||||
|
├── Platform
|
||||||
|
│ ├── Users
|
||||||
|
│ ├── Workspaces
|
||||||
|
│ └── Activity
|
||||||
|
└── Developer
|
||||||
|
├── API Keys
|
||||||
|
├── Webhooks
|
||||||
|
└── Logs
|
||||||
|
```
|
||||||
|
|
||||||
|
**Changes:**
|
||||||
|
- Grouped by domain (services, commerce, platform, developer)
|
||||||
|
- Consistent iconography
|
||||||
|
- Permission-based visibility
|
||||||
|
- Mobile-responsive sidebar
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Global Search (⌘K)
|
### Admin Menu Provider
|
||||||
|
|
||||||
Unified search across resources with keyboard navigation.
|
Interface for modules to register admin navigation.
|
||||||
|
|
||||||
**Files:**
|
**Files:**
|
||||||
- `src/Search/Contracts/SearchProvider.php` - Provider interface
|
- `Contracts/AdminMenuProvider.php`
|
||||||
- `src/Search/SearchProviderRegistry.php` - Registry with fuzzy matching
|
- Permission checks per item
|
||||||
- `src/Search/SearchResult.php` - Result DTO
|
- Configurable TTL caching
|
||||||
- `src/Search/Providers/AdminPageSearchProvider.php` - Built-in provider
|
- Priority constants for ordering
|
||||||
- `src/Website/Hub/View/Modal/Admin/GlobalSearch.php` - Livewire component
|
|
||||||
|
|
||||||
**Features:**
|
|
||||||
- ⌘K / Ctrl+K keyboard shortcut
|
|
||||||
- Arrow key navigation, Enter to select
|
|
||||||
- Fuzzy matching support
|
|
||||||
- Recent searches
|
|
||||||
- Grouped results by provider
|
|
||||||
|
|
||||||
**Usage:**
|
|
||||||
```php
|
|
||||||
// Register custom provider
|
|
||||||
app(SearchProviderRegistry::class)->register(new MySearchProvider());
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Design Decisions
|
|
||||||
|
|
||||||
### Soketi (Real-time WebSocket)
|
|
||||||
|
|
||||||
Excluded per project decision. Self-hosted Soketi integration not required at this time.
|
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,31 @@
|
||||||
{
|
{
|
||||||
"name": "host-uk/core-admin",
|
"name": "host-uk/core-admin",
|
||||||
"description": "Admin panel module for Core PHP framework",
|
"description": "Admin panel module for Core PHP framework",
|
||||||
"keywords": ["laravel", "admin", "panel", "dashboard"],
|
"keywords": [
|
||||||
"license": "EUPL-1.2",
|
"laravel",
|
||||||
"require": {
|
"admin",
|
||||||
"php": "^8.2",
|
"panel",
|
||||||
"host-uk/core": "@dev"
|
"dashboard"
|
||||||
},
|
],
|
||||||
"autoload": {
|
"license": "EUPL-1.2",
|
||||||
"psr-4": {
|
"require": {
|
||||||
"Core\\Admin\\": "src/",
|
"php": "^8.2",
|
||||||
"Website\\Hub\\": "src/Website/Hub/"
|
"host-uk/core": "@dev"
|
||||||
}
|
},
|
||||||
},
|
"autoload": {
|
||||||
"extra": {
|
"psr-4": {
|
||||||
"laravel": {
|
"Core\\Admin\\": "src/",
|
||||||
"providers": [
|
"Website\\Hub\\": "src/Website/Hub/",
|
||||||
"Core\\Admin\\Boot"
|
"Core\\Service\\Admin\\": "Service/"
|
||||||
]
|
}
|
||||||
}
|
},
|
||||||
},
|
"extra": {
|
||||||
"minimum-stability": "stable",
|
"laravel": {
|
||||||
"prefer-stable": true
|
"providers": [
|
||||||
|
"Core\\Admin\\Boot"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"prefer-stable": true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue