44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Beike\Admin\View\Components;
|
|
|
|
use Illuminate\View\Component;
|
|
|
|
class Header extends Component
|
|
{
|
|
public array $links = [];
|
|
|
|
/**
|
|
* Create a new component instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->addLink('管理首页', admin_route('home.index'), equal_route('admin.home.index'));
|
|
$this->addLink('订单管理', admin_route('orders.index'), equal_route('admin.orders.index'));
|
|
$this->addLink('商品管理', admin_route('products.index'), equal_route('admin.products.index'));
|
|
$this->addLink('会员管理', admin_route('customers.index'), equal_route('admin.customers.index'));
|
|
$this->addLink('系统设置', admin_route('settings.index'), equal_route('admin.settings.index'));
|
|
}
|
|
|
|
/**
|
|
* Get the view / contents that represent the component.
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function render()
|
|
{
|
|
return view('admin::components.header');
|
|
}
|
|
|
|
private function addLink($title, $url, $active = false)
|
|
{
|
|
$this->links[] = [
|
|
'title' => $title,
|
|
'url' => $url,
|
|
'active' => $active
|
|
];
|
|
}
|
|
}
|