24 lines
393 B
PHP
24 lines
393 B
PHP
<?php
|
|
|
|
namespace App\Support\Breadcrumb;
|
|
|
|
class Breadcrumb
|
|
{
|
|
|
|
public array $breadcrumbs = [];
|
|
|
|
public function getBreadcrumbs(): array
|
|
{
|
|
return $this->breadcrumbs;
|
|
}
|
|
|
|
public function add(string $label, string $url = ''): static
|
|
{
|
|
$this->breadcrumbs[] = [
|
|
'label' => $label,
|
|
'url' => $url
|
|
];
|
|
return $this;
|
|
}
|
|
}
|