System component Footer

# Make

Системный компонент Footer служит для создания блока футера в MoonShine.

Создать Footer можно воспользовавшись статическим методом make() класса Footer.

make(array $components = [])
  • $components - массив компонентов которые располагаются в футере.
namespace App\MoonShine;
 
use App\MoonShine\Components\MyComponent;
use MoonShine\Components\Layout\Footer;
use MoonShine\Components\Layout\LayoutBuilder;
use MoonShine\Contracts\MoonShineLayoutContract;
 
final class MoonShineLayout implements MoonShineLayoutContract
{
public static function build(): LayoutBuilder
{
return LayoutBuilder::make([
//...
 
Footer::make([
MyComponent::make(),
])
]);
}
}

Метод copyright() позволяет оформить блок copyright в футуре.

copyright(string|Closure $text)
namespace App\MoonShine;
 
use MoonShine\Components\Layout\Footer;
use MoonShine\Components\Layout\LayoutBuilder;
use MoonShine\Contracts\MoonShineLayoutContract;
 
final class MoonShineLayout implements MoonShineLayoutContract
{
public static function build(): LayoutBuilder
{
return LayoutBuilder::make([
//...
 
Footer::make()
->copyright(fn (): string => <<<'HTML'
&copy; 2021-2023 Made with ❤️ by
<a href="https://cutcode.dev"
class="font-semibold text-primary hover:text-secondary"
target="_blank"
>
CutCode
</a>
HTML)
]);
}
}

Метод menu() позволяет оформить блок в меню в футуре.

menu(array $data)
  • $data - массив элементов, где ключ - url, а значение - название пункта меню.
namespace App\MoonShine;
 
use MoonShine\Components\Layout\Footer;
use MoonShine\Components\Layout\LayoutBuilder;
use MoonShine\Contracts\MoonShineLayoutContract;
 
final class MoonShineLayout implements MoonShineLayoutContract
{
public static function build(): LayoutBuilder
{
return LayoutBuilder::make([
//...
 
Footer::make()
->menu([
'https://moonshine-laravel.com/docs' => 'Documentation',
])
]);
}
}