Introduction

Lean is an admin panel focused on building admin panels for customers. As such, the feature set is centered around this.

Lean is fully customizable to your needs (views, language strings, backend logic) while being extremely pure in the sense that it does not pollute your application with repetitive code or new database tables.

Create resources, define fields in them, see that your admin panel works in the browser, and customize what you need.

That is the workflow of Lean. It starts like Nova and it ends like a handwritten solution.

Concepts

Here's a quick overview of the concepts used in Lean. Each of them has a dedicated page in the docs, so this will be a brief look.

Resources

Resources tell Lean how to talk to your database. Each resource represents an Eloquent model in your codebase.

Resources are completely static. They're purely declarative and have no state.

The most important parts of a resource are:

public static string $model = App\MyModel::class;

public static array $lang = [
    'create.submit' => '...',
];

public static array $searchable = [
    'id',
    'title',
];

public static string $title = 'id';

public static function fields(): Fields[]

public static function label(): string

public static function pluralLabel(): string

Fields

Fields are classes returned from a resource's fields() method.

They (roughly) represent individual columns in your database.

Fields are used like this:

public static function fields(): array
{
    return [
        ID::make('id'),
        Text::make('title')->rules('max:100'),
        Trix::make('description')->display('show', 'write'),
        Pikaday::make('created_at')
            ->placeholder('DD.MM.YYYY')
            ->jsFormat('DD.MM.YYYY')
            ->phpFormat('d.m.Y')
            ->display('show');
    ];
}

Actions

Actions refer to the CRUD actions used by the resources (index/create/show/edit). You can read more about them on the Actions page.

Pages

CRUD is the bulk of an admin panel, but not all of it. Lean lets you create custom pages too. They appear in the menu alongside resources and are created as simple Livewire components. So you can use any logic in them — they let you have a page in the admin panel that's completely yours. Anything that you can do in Livewire, you can put into custom pages. With no extra work.