No description
Find a file
Claude d1afc5592a
test: add tests for admin modal components (Settings, PlatformUser, ActivityLog, ServiceManager)
Adds Pest test suites for the four critical admin modals using test double
components, following the existing LivewireModalTest.php pattern. Covers
tab navigation, form validation, CRUD flows, filter combinations, and
state management. Fixes #7.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:51:57 +00:00
.forgejo/workflows fix(ci): install zip in release workflow 2026-02-27 17:44:01 +00:00
.gemini Initial commit 2026-01-26 20:48:24 +00:00
.github Initial commit 2026-01-26 20:48:24 +00:00
app Initial commit 2026-01-26 20:48:24 +00:00
bootstrap Initial commit 2026-01-26 20:48:24 +00:00
changelog/2026/jan docs: add January 2026 completed items to changelog 2026-01-29 19:51:57 +00:00
config Initial commit 2026-01-26 20:48:24 +00:00
database Initial commit 2026-01-26 20:48:24 +00:00
docs docs: add package documentation 2026-01-29 10:47:50 +00:00
public Initial commit 2026-01-26 20:48:24 +00:00
resources monorepo sepration 2026-01-26 20:56:28 +00:00
routes Initial commit 2026-01-26 20:48:24 +00:00
Service Add Hub service layer and admin navigation restructure 2026-01-27 16:12:01 +00:00
src fix(dx): add strict_types, composer scripts, and fix test discovery 2026-03-17 09:04:27 +00:00
storage Initial commit 2026-01-26 20:48:24 +00:00
tests test: add tests for admin modal components (Settings, PlatformUser, ActivityLog, ServiceManager) 2026-03-24 16:51:57 +00:00
.editorconfig Initial commit 2026-01-26 20:48:24 +00:00
.env.example Initial commit 2026-01-26 20:48:24 +00:00
.gitattributes Initial commit 2026-01-26 20:48:24 +00:00
.gitignore chore: add .core/ and .idea/ to .gitignore 2026-03-15 10:17:50 +00:00
AGENTS.md Initial commit 2026-01-26 20:48:24 +00:00
artisan Initial commit 2026-01-26 20:48:24 +00:00
CLAUDE.md fix(dx): add strict_types, composer scripts, and fix test discovery 2026-03-17 09:04:27 +00:00
cliff.toml Initial commit 2026-01-26 20:48:24 +00:00
composer.json fix(dx): add strict_types, composer scripts, and fix test discovery 2026-03-17 09:04:27 +00:00
FINDINGS.md docs: add Phase 0 environment assessment and test baseline (#2) 2026-02-20 02:25:01 +00:00
GEMINI.md Initial commit 2026-01-26 20:48:24 +00:00
LICENSE Initial commit 2026-01-26 20:48:24 +00:00
package.json Initial commit 2026-01-26 20:48:24 +00:00
phpunit.xml fix(dx): add strict_types, composer scripts, and fix test discovery 2026-03-17 09:04:27 +00:00
postcss.config.js Initial commit 2026-01-26 20:48:24 +00:00
README.md feat: rename package to lthn/php-admin for Packagist 2026-03-09 17:59:52 +00:00
tailwind.config.js Initial commit 2026-01-26 20:48:24 +00:00
TODO.md test(layout): add comprehensive tests for HLCRF layout system 2026-01-29 19:27:30 +00:00
vite.config.js Initial commit 2026-01-26 20:48:24 +00:00

Core Admin Package

Admin panel components, Livewire modals, and service management interface for the Core PHP Framework.

Installation

composer require lthn/php-admin

Features

Admin Menu System

Declarative menu registration with automatic permission checking:

use Core\Front\Admin\Contracts\AdminMenuProvider;

class MyModuleMenu implements AdminMenuProvider
{
    public function registerMenu(AdminMenuRegistry $registry): void
    {
        $registry->addItem('products', [
            'label' => 'Products',
            'icon' => 'cube',
            'route' => 'admin.products.index',
            'permission' => 'products.view',
        ]);
    }
}

Livewire Modals

Full-page Livewire components for admin interfaces:

use Livewire\Component;
use Livewire\Attributes\Title;

#[Title('Product Manager')]
class ProductManager extends Component
{
    public function render(): View
    {
        return view('admin.products.manager')
            ->layout('hub::admin.layouts.app');
    }
}

Form Components

Reusable form components with authorization:

  • <x-forms.input> - Text inputs with validation
  • <x-forms.select> - Dropdowns
  • <x-forms.checkbox> - Checkboxes
  • <x-forms.toggle> - Toggle switches
  • <x-forms.textarea> - Text areas
  • <x-forms.button> - Buttons with loading states
<x-forms.input
    name="name"
    label="Product Name"
    wire:model="name"
    required
/>

Extensible search provider system:

use Core\Admin\Search\Contracts\SearchProvider;

class ProductSearchProvider implements SearchProvider
{
    public function search(string $query): array
    {
        return Product::where('name', 'like', "%{$query}%")
            ->take(5)
            ->get()
            ->map(fn($p) => new SearchResult(
                title: $p->name,
                url: route('admin.products.edit', $p),
                icon: 'cube'
            ))
            ->toArray();
    }
}

Service Management Interface

Unified dashboard for viewing workspace services and statistics.

Configuration

The package auto-discovers admin menu providers and search providers from your modules.

Requirements

  • PHP 8.2+
  • Laravel 11+ or 12+
  • Livewire 3.0+
  • Flux UI 2.0+

Changelog

See changelog/2026/jan/features.md for recent changes.

License

EUPL-1.2 - See LICENSE for details.