MoonShine admin panel integration for Yii3.
This package is still experimental. Some MoonShine features are not fully wired to Yii3 services yet.
- PHP 8.2+
- Yii3
- Composer 2.5+
composer require moonshine/yiiRun the install command:
./yii moonshine:installResources and pages are auto-discovered from:
src/MoonShine/Resources- for resources implementingResourceContractsrc/MoonShine/Pages- for pages implementingPageContract
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',
],
],
];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());
}Copyable examples are stored in examples.
examples/theme-generator- a MoonShine UI showcase page with local demo assets.
We welcome contributions from the community! If you're interested in improving this integration, feel free to open issues, submit PRs, or suggest improvements.