Decoration Block

# Make

The Block decorator allows you to create stylized blocks.

You can create a Block using the static make() method.

make(Closure|string|array $labelOrFields = '', array $fields = [])
use MoonShine\Decorations\Block;
use MoonShine\Fields\Text;
 
//...
 
public function components(): array
{
return [
Block::make('Block title', [
Text::make('Name', 'first_name')
])
];
}
 
//...

# No title

If the block does not need title, then the make() method only has to pass an array.

use MoonShine\Decorations\Block;
use MoonShine\Fields\Text;
 
//...
 
public function components(): array
{
return [
Block::make([
Text::make('Name', 'first_name')
])
];
}
 
//...