Pages

Resources work great for models, but sometimes you need to create extra pages in your administration.

Dashboards, settings pages, and more.

To achieve this, you may use custom pages.

Creating pages

A page is a Livewire component that extends the Lean\Livewire\Page class.

This class is an almost pure Livewire component, with one requirement: a label() method that returns the name of the page for display in navigation.

class Dashboard extends Page
{
    public $name = 'Sam';

    public static function label(): string
    {
        return 'Dashboard';
    }

    public function render()
    {
        return view('lean.dashboard');
    }
}