Installation

You're browsing the documentation for an old version of MoonShine. Consider upgrading your project to MoonShine 2.x.

# Requirements

To use MoonShine, the following requirements must be met prior to installation:

  • php >=8.0
  • laravel >= 9.0
  • composer

1 Composer

composer require moonshine/moonshine

2 Installation

php artisan moonshine:install

This command will add config/moonshine.php with the basic settings. More about the config file

A directory containing the admin panel and resources will also be added - app/MoonShine. More about Resources

It will also add MoonShineServiceProvider App\Providers\MoonShineServiceProvider where you need to register resources. More about Resources

3 Create an Administrator

php artisan moonshine:user

4 Resource registration and menu configuration

To register new resources in the MoonShine and configure a menu, we need app/Providers/MoonShineServiceProvider.php

namespace App\Providers;
 
use Illuminate\Support\ServiceProvider;
use MoonShine\MoonShine;
use MoonShine\Menu\MenuItem;
use MoonShine\Resources\MoonShineUserResource;
 
class MoonShineServiceProvider extends ServiceProvider
{
public function boot(): void
{
 
app(MoonShine::class)->menu([
MenuItem::make('Admins', new MoonShineUserResource()),
]);
 
}
}

In this example, we have added a menu item with panel admins. More about Menu

Great! Now you can create and register sections of the future admin panel and proceed with the real work! But don't forget to read the documentation all the way through!

By default, the admin panel is accessed by url /moonshine. You can change the url in config file .