Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Log1x/crumb
A simple breadcrumb package for Sage 10.
https://github.com/Log1x/crumb
acorn breadcrumb laravel roots sage sage10 wordpress
Last synced: 1 day ago
JSON representation
A simple breadcrumb package for Sage 10.
- Host: GitHub
- URL: https://github.com/Log1x/crumb
- Owner: Log1x
- License: mit
- Created: 2020-12-20T07:05:18.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-16T23:56:18.000Z (12 months ago)
- Last Synced: 2024-11-07T23:39:42.996Z (5 days ago)
- Topics: acorn, breadcrumb, laravel, roots, sage, sage10, wordpress
- Language: PHP
- Homepage: https://github.com/log1x/crumb
- Size: 19.5 KB
- Stars: 38
- Watchers: 6
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Crumb
![Latest Stable Version](https://img.shields.io/packagist/v/log1x/crumb?style=flat-square)
![Build Status](https://img.shields.io/github/actions/workflow/status/log1x/crumb/main.yml?branch=master&style=flat-square)
![Total Downloads](https://img.shields.io/packagist/dt/log1x/crumb?style=flat-square)A simple breadcrumb package for Sage 10.
## Requirements
- [Sage](https://github.com/roots/sage) >= 10.0
- [PHP](https://secure.php.net/manual/en/install.php) >= 7.4
- [Composer](https://getcomposer.org/download/)## Installation
Install via Composer:
```bash
$ composer require log1x/crumb
```## Usage
Publish the breadcrumb configuration file using Acorn:
```sh
$ wp acorn vendor:publish --provider="Log1x\Crumb\CrumbServiceProvider"
```### Example
```php
# app/View/Components/Breadcrumb.phptoArray();
}/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|string
*/
public function render()
{
return $this->view('components.breadcrumb');
}
}
``````php
# views/components/breadcrumb.blade.php@if (! empty($items))
@foreach ($items as $item)
@if (empty($item['url']))
{{ $item['label'] }}
@else
@if ($loop->first)
{!! $item['label'] !!}
@else
{!! $item['label'] !!}
@endif
@if (!$loop->last)
@endif
@endif
@endforeach
@endif
```## Bug Reports
If you discover a bug in Crumb, please [open an issue](https://github.com/log1x/crumb/issues).
## Contributing
Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.
## License
Crumb is provided under the [MIT License](https://github.com/log1x/crumb/blob/master/LICENSE.md).