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
|
||||
|
||||
### 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:**
|
||||
- `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>
|
||||
**Structure:**
|
||||
```
|
||||
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:**
|
||||
- `src/Search/Contracts/SearchProvider.php` - Provider interface
|
||||
- `src/Search/SearchProviderRegistry.php` - Registry with fuzzy matching
|
||||
- `src/Search/SearchResult.php` - Result DTO
|
||||
- `src/Search/Providers/AdminPageSearchProvider.php` - Built-in provider
|
||||
- `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.
|
||||
- `Contracts/AdminMenuProvider.php`
|
||||
- Permission checks per item
|
||||
- Configurable TTL caching
|
||||
- Priority constants for ordering
|
||||
|
|
|
|||
|
|
@ -1,25 +1,31 @@
|
|||
{
|
||||
"name": "host-uk/core-admin",
|
||||
"description": "Admin panel module for Core PHP framework",
|
||||
"keywords": ["laravel", "admin", "panel", "dashboard"],
|
||||
"license": "EUPL-1.2",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"host-uk/core": "@dev"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Core\\Admin\\": "src/",
|
||||
"Website\\Hub\\": "src/Website/Hub/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Core\\Admin\\Boot"
|
||||
]
|
||||
}
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true
|
||||
"name": "host-uk/core-admin",
|
||||
"description": "Admin panel module for Core PHP framework",
|
||||
"keywords": [
|
||||
"laravel",
|
||||
"admin",
|
||||
"panel",
|
||||
"dashboard"
|
||||
],
|
||||
"license": "EUPL-1.2",
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"host-uk/core": "@dev"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Core\\Admin\\": "src/",
|
||||
"Website\\Hub\\": "src/Website/Hub/",
|
||||
"Core\\Service\\Admin\\": "Service/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Core\\Admin\\Boot"
|
||||
]
|
||||
}
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue