Skip to content

Repository files navigation

MoonShine for Yii3

MoonShine admin panel integration for Yii3.

This package is still experimental. Some MoonShine features are not fully wired to Yii3 services yet.

Requirements

  • PHP 8.2+
  • Yii3
  • Composer 2.5+

Installation

composer require moonshine/yii

Run the install command:

./yii moonshine:install

Configuration

Resources and pages are auto-discovered from:

  • src/MoonShine/Resources - for resources implementing ResourceContract
  • src/MoonShine/Pages - for pages implementing PageContract

You can customize paths in your application's config/params.php:

return [
    'moonshine/yii' => [
        'resources' => [
            'directory' => '@src/MoonShine/Resources',
            'namespace' => 'App\\MoonShine\\Resources',
        ],
        'pages' => [
            'directory' => '@src/MoonShine/Pages',
            'namespace' => 'App\\MoonShine\\Pages',
            'dashboard' => 'App\\MoonShine\\Pages\\Dashboard',
            'login' => 'App\\MoonShine\\Pages\\LoginPage',
        ],
    ],
];

Routing

Routes are automatically loaded from controller attributes using Symfony Routing component:

use Symfony\Component\Routing\Attribute\Route;

#[Route('/admin/custom', name: 'custom.page')]
public function custom(MyCustomPage $page): ResponseInterface
{
    return new Response(body: (string) $page->render());
}

Examples

Copyable examples are stored in examples.

  • examples/theme-generator - a MoonShine UI showcase page with local demo assets.

Contributing

We welcome contributions from the community! If you're interested in improving this integration, feel free to open issues, submit PRs, or suggest improvements.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages