-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
<ol class="breadcrumb-list app-header__breadcrumb"> | ||
<li> | ||
<a href="/">Dashboard</a> | ||
</li> | ||
<li> | ||
<span aria-current="page">Products</span> | ||
</li> | ||
@foreach($breadcrumbs as $item) | ||
<li> | ||
@if($loop->last) | ||
<span aria-current="page">{{ $item['label'] }}</span> | ||
@else | ||
<a href="{{ $item['uri'] }}">{{ $item['label'] }}</a> | ||
@endif | ||
</li> | ||
@endforeach | ||
</ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Cone\Root\View\Components\Layout; | ||
|
||
use Cone\Root\Root; | ||
use Illuminate\Http\Request; | ||
use Illuminate\View\Component; | ||
use Illuminate\View\View; | ||
|
||
class Breadcrumbs extends Component | ||
{ | ||
/** | ||
* The HTTP request. | ||
*/ | ||
protected Request $request; | ||
|
||
/** | ||
* Create a new component instance. | ||
*/ | ||
public function __construct(Request $request) | ||
{ | ||
$this->request = $request; | ||
} | ||
|
||
/** | ||
* Get the view / view contents that represent the component. | ||
*/ | ||
public function render(): View | ||
{ | ||
return $this->view('root::components.layout.breadcrumbs', [ | ||
'breadcrumbs' => Root::instance()->breadcrumbs->resolve($this->request), | ||
]); | ||
} | ||
} |