37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Shared\Infrastructure\ApiPlatform\Resource;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\Get;
|
|
use App\Shared\Infrastructure\ApiPlatform\State\SidebarProvider;
|
|
|
|
#[ApiResource(
|
|
operations: [
|
|
new Get(
|
|
uriTemplate: '/sidebar',
|
|
provider: SidebarProvider::class,
|
|
),
|
|
],
|
|
)]
|
|
class SidebarResource
|
|
{
|
|
/** @var list<array{label: string, icon: string, items: list<array{label: string, to: string, icon: string}>}> */
|
|
public array $sections = [];
|
|
|
|
/** @var list<string> */
|
|
public array $disabledRoutes = [];
|
|
|
|
/**
|
|
* @param list<array{label: string, icon: string, items: list<array{label: string, to: string, icon: string}>}> $sections
|
|
* @param list<string> $disabledRoutes
|
|
*/
|
|
public function __construct(array $sections = [], array $disabledRoutes = [])
|
|
{
|
|
$this->sections = $sections;
|
|
$this->disabledRoutes = $disabledRoutes;
|
|
}
|
|
}
|