Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mares29/laravel-breadcrumb
Breadcrumb for Laravel 5
https://github.com/mares29/laravel-breadcrumb
breadcrumbs laravel laravel-5-package laravel-package
Last synced: 12 days ago
JSON representation
Breadcrumb for Laravel 5
- Host: GitHub
- URL: https://github.com/mares29/laravel-breadcrumb
- Owner: mares29
- Created: 2018-01-22T11:08:19.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-31T20:21:53.000Z (almost 3 years ago)
- Last Synced: 2024-12-02T20:44:41.882Z (about 1 month ago)
- Topics: breadcrumbs, laravel, laravel-5-package, laravel-package
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Breadcrumb for Laravel 5
This package provide simple way to implement breadcrumb for your laravel 5 application.
## Install
Via Composer
``` bash
$ composer require mares29/laravel-breadcrumb
```Laravel 5.5+ automaticly register service provider and set Alias thanks to auto-discovery. With lower laravel version add to **app.php**
``` php
'providers' => [
\Mares29\Breadcrumb\BreadcrumbServiceProvider::class,
]'aliases' => [
'Breadcrumb' => \Mares29\Breadcrumb\Facades\BreadcrumbFacade::class,
]
```## Usage
Use Facade to add breadcrumb links.
``` php
Breadcrumb::addLink("link title", "link route");
```You can also add more links.
``` php
Breadcrumb::addLink("link title", "link route")
->addLink("another link title", "link route");
```And finaly render breadcrumb using render method in blade template.
``` php
{!! Breadcrumb::render() !!}
```By default, first link (home link) is set automaticly with `config('app.name')` and links to `url("/")`. You can modify this by
``` php
Breadcrumb::setHomeLink("new home link", "/home.html");
```**Need to modify breadcrumb html?** Use `vendor:publish` command and export breadcrumb view into resources folder.
``` terminal
php artisan vendor:publish --provider="Mares29\Breadcrumb\BreadcrumbServiceProvider"
```## Credits
- [Karel Mares](https://github.com/mares29)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.