update 1.0.8.0

Commits for version update
This commit is contained in:
Manish Verma
2016-10-17 12:02:27 +05:30
parent dec927987b
commit 76e85db070
9674 changed files with 495757 additions and 58922 deletions

View File

@@ -10,6 +10,9 @@ indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
[ISSUE_TEMPLATE.md]
trim_trailing_whitespace = false
[*.yml]
indent_size = 2
indent_style = space

View File

@@ -1,14 +1,13 @@
language: php
php:
- 7.0
- 5.6
- 5.5
- 5.4
- hhvm
install:
- composer self-update # https://github.com/phpspec/prophecy/issues/149
- travis_retry composer install --no-interaction --prefer-source
- travis_retry composer install --no-interaction
script:
- phpunit --coverage-clover build/logs/clover.xml

View File

@@ -4,33 +4,4 @@
.. This file is for GitHub (https://github.com/blog/1184-contributing-guidelines)
Please submit support requests, bug reports, feature requests and pull requests using `GitHub issues <https://github.com/davejamesmiller/laravel-breadcrumbs/issues>`_.
All **support requests / bug reports** should include the following:
- The complete error message, including file & line numbers
- Steps to reproduce the problem
- Laravel Breadcrumbs version
- Laravel version
- PHP version
You should also include copies of the following where appropriate:
- ``app/Http/breadcrumbs.php``
- ``config/breadcrumbs.php`` (if used)
- The view or layout that outputs the breadcrumbs
- The custom breadcrumbs template (if applicable)
- The ``providers`` and ``aliases`` sections of ``config/app.php`` (Note: **not the Encryption Key section** which should be kept private) -- in case there's a conflict with another package
- Any other relevant files
**Note:** Don't be afraid to go into the Laravel Breadcrumbs code and use ``var_dump()`` (or ``print_r()``) to see what's happening and try to fix your own problems! A pull request or detailed bug report is much more likely to get attention than a vague error report. Also make sure you read the `documentation <http://laravel-breadcrumbs.davejamesmiller.com/en/latest/>`_ carefully.
Any **feature requests / pull requests** should include details of what you are trying to achieve (use case) to explain why your request should be implemented.
.. This text is also in docs/contributing.rst
If you want to submit a **bug fix**, please make your changes in a new branch (based on the ``develop`` branch), then open a `pull request <https://github.com/davejamesmiller/laravel-breadcrumbs/pulls>`_. (The `Contributing page of the docs <http://laravel-breadcrumbs.davejamesmiller.com/en/latest/contributing.html>`_ may help you to get started if you've not done this before.)
.. This text is also in docs/contributing.rst
If you want to submit a **new feature**, it's usually best to open an `issue <https://github.com/davejamesmiller/laravel-breadcrumbs/issues>`_ to discuss the idea first -- to make sure it will be accepted before spending too much time on it. (Of course you can go ahead and develop it first if you prefer!) Please be sure to update the documentation as well.
If you have any suggestions for improving the **documentation** -- especially if anything is unclear to you and could be explained better -- please let me know. (Or just edit it yourself and make a pull request.)
Before submitting a support request, bug report, feature request or pull request, please take a moment to read the instructions in the `README <README.rst#documentation>`_ file. Thank you.

View File

@@ -0,0 +1,49 @@
(For support requests / bug reports, please complete the following - or delete if not applicable.)
**Summary of issue**
**The complete error message, including file & line numbers**
**Software versions**
Laravel Breadcrumbs:
Laravel:
PHP:
**Copy of `routes/breadcrumbs.php` (or `app/Http/breadcrumbs.php`)**
```php
```
**Copy of `routes/web.php` (or `app/Http/routes.php`)**
```php
```
**Copy of `config/breadcrumbs.php` (if used)**
```php
```
**Copy of the view and/or layout files (e.g. `resources/views/home.blade.php`, `resources/views/layouts/master.blade.php`)**
```php
```
**Copy of the custom breadcrumbs template (if used, e.g. `resources/views/_partials/breadcrumbs.blade.php`)**
```php
```
**Copy of `config/app.php`**
```php
```
**Copy of any other relevant files**
```php
```
**Any other information**

View File

@@ -0,0 +1,82 @@
################################################################################
Laravel Breadcrumbs 3
################################################################################
.. |stable| image:: https://poser.pugx.org/davejamesmiller/laravel-breadcrumbs/v/stable.png
:alt: Latest Stable Version
:target: https://packagist.org/packages/davejamesmiller/laravel-breadcrumbs
.. |downloads| image:: https://img.shields.io/packagist/dt/davejamesmiller/laravel-breadcrumbs.svg?style=flat
:alt: Total Downloads
:target: https://packagist.org/packages/davejamesmiller/laravel-breadcrumbs
.. |references| image:: https://www.versioneye.com/php/davejamesmiller:laravel-breadcrumbs/reference_badge.svg?style=flat
:alt: Reference Status
:target: https://www.versioneye.com/php/davejamesmiller:laravel-breadcrumbs/references
.. |build| image:: https://img.shields.io/travis/davejamesmiller/laravel-breadcrumbs/master.svg?style=flat
:alt: Build Status
:target: https://travis-ci.org/davejamesmiller/laravel-breadcrumbs
.. |coverage| image:: https://img.shields.io/coveralls/davejamesmiller/laravel-breadcrumbs.png
:alt: Coverage Status
:target: https://coveralls.io/r/davejamesmiller/laravel-breadcrumbs
.. |dependencies| image:: https://www.versioneye.com/php/davejamesmiller:laravel-breadcrumbs/badge.svg
:alt: Dependency Status
:target: https://www.versioneye.com/php/davejamesmiller:laravel-breadcrumbs
|stable| |downloads| |references|
|build| |coverage| |dependencies|
A simple Laravel-style way to create breadcrumbs in `Laravel 5 <http://laravel.com/>`_.
(If you are still using Laravel 4.0 to 4.2 please use the `2.x version <https://github.com/davejamesmiller/laravel-breadcrumbs/tree/2.x>`_ of Laravel Breadcrumbs instead.)
================================================================================
Documentation
================================================================================
`View documentation >> <http://laravel-breadcrumbs.davejamesmiller.com/>`_
**Note:** If you have any suggestions for improving the documentation -- especially if anything is unclear to you and could be explained better -- please let me know. (Or just edit it yourself and make a pull request.)
================================================================================
Support Requests / Bug Reports
================================================================================
All support requests / bug reports should be submitted using `GitHub issues <https://github.com/davejamesmiller/laravel-breadcrumbs/issues>`_, and **must** include the following:
- The complete error message, including file & line numbers
- Steps to reproduce the problem
- Laravel Breadcrumbs version
- Laravel version
- PHP version
- Copies of the following files (you can use `Gist <https://gist.github.com/>`_ if they're very long):
- ``routes/breadcrumbs.php`` or ``app/Http/breadcrumbs.php``
- ``config/breadcrumbs.php`` (if used)
- The view and/or layout files
- The custom breadcrumbs template (if applicable)
- ``config/app.php``
- Any other relevant files
Before you do - please don't be afraid to go into the Laravel Breadcrumbs code (``vendor/davejamesmiller/laravel-breadcrumbs/src/``) and use ``var_dump()`` (or ``dd()`` or ``print_r()``) to see what's happening and try to fix your own problems! A pull request or detailed bug report is much more likely to get attention than a vague error report. Also make sure you read the `documentation <http://laravel-breadcrumbs.davejamesmiller.com/en/latest/>`_ carefully.
================================================================================
Feature Requests / Pull Requests
================================================================================
.. NOTE: This text is also in docs/contributing.rst
Any feature requests / pull requests should include details of what you are trying to achieve (use case) to explain why your request should be implemented.
If you want to submit a **bug fix**, please make your changes in a new branch, then open a `pull request <https://github.com/davejamesmiller/laravel-breadcrumbs/pulls>`_. (The `Contributing page of the docs <http://laravel-breadcrumbs.davejamesmiller.com/en/latest/contributing.html>`_ may help you to get started if you've not done this before.)
If you want to submit a **new feature**, it's usually best to open an `issue <https://github.com/davejamesmiller/laravel-breadcrumbs/issues>`_ to discuss the idea first -- to make sure it will be accepted before spending too much time on it. (Of course you can go ahead and develop it first if you prefer!) Please be sure to include unit tests and update the documentation as well.
For more details see the `Contributing <http://laravel-breadcrumbs.davejamesmiller.com/en/latest/contributing.html>`_ section of the documentation.
--------------------------------------------------------------------------------
Copyright © 2013-2015 Dave James Miller. Released under the `MIT License <docs/license.rst>`_.

View File

@@ -4,7 +4,7 @@
"keywords": [
"laravel"
],
"homepage": "https://github.com/davejamesmiller/laravel-breadcrumbs",
"homepage": "http://laravel-breadcrumbs.davejamesmiller.com",
"authors": [
{
"name": "Dave James Miller",
@@ -20,7 +20,7 @@
},
"require-dev": {
"mockery/mockery": "0.9.*",
"orchestra/testbench": "3.0.*",
"orchestra/testbench": "3.2.*|3.3.*",
"phpunit/phpunit": "4.*",
"satooshi/php-coveralls": "0.6.*"
},

View File

@@ -45,9 +45,9 @@ The ``$data`` array's entries will be merged into the breadcrumb as properties,
.. code-block:: html+php
<li><a href="{{{ $breadcrumb->url }}}">
<img src="/images/icons/{{{ $breadcrumb->icon }}}">
{{{ $breadcrumb->title }}}
<li><a href="{{ $breadcrumb->url }}">
<img src="/images/icons/{{ $breadcrumb->icon }}">
{{ $breadcrumb->title }}
</a></li>
Do not use the following keys in your data array, as they will be overwritten: ``title``, ``url``, ``first``, ``last``.
@@ -57,7 +57,38 @@ Do not use the following keys in your data array, as they will be overwritten: `
Defining breadcrumbs in a different file
================================================================================
If you don't want to use ``app/Http/breadcrumbs.php``, you can define them in ``app/Http/routes.php`` or any other file as long as it's loaded by Laravel.
If you don't want to use ``routes/breadcrumbs.php`` (or ``app/Http/breadcrumbs.php`` in Laravel 5.2 and below), you can create a custom service provider to use instead of ``DaveJamesMiller\Breadcrumbs\ServiceProvider`` and override the ``registerBreadcrumbs()`` method:
.. code-block:: php
<?php
namespace App\Providers;
use DaveJamesMiller\Breadcrumbs\ServiceProvider;
class BreadcrumbsServiceProvider extends ServiceProvider
{
public function registerBreadcrumbs()
{
require base_path('path/to/breadcrumbs.php');
}
}
If you are creating your own package, simply load them from your service provider's ``boot()`` method:
.. code-block:: php
class MyServiceProvider extends ServiceProvider
{
public function register() {}
public function boot()
{
if (class_exists('Breadcrumbs'))
require __DIR__ . '/breadcrumbs.php';
}
}
.. _switching-views:
@@ -126,8 +157,8 @@ If you want to pass an array of parameters instead you can use these methods:
By default an exception will be thrown if the breadcrumb doesn't exist, so you know to add it. If you want suppress this you can call the following methods instead:
- ``Breadcrumbs::renderIfExists()`` (returns an empty string)
- ``Breadcrumbs::renderArrayIfExists()`` (returns an empty string)
- ``Breadcrumbs::renderIfExistsArray()`` (returns an empty string) (was ``renderArrayIfExists`` before 3.0.0)
- ``Breadcrumbs::generateIfExists()`` (returns an empty array)
- ``Breadcrumbs::generateArrayIfExists()`` (returns an empty array)
- ``Breadcrumbs::generateIfExistsArray()`` (returns an empty array) (was ``generateArrayIfExists`` before 3.0.0)
Alternatively you can call ``Breadcrumbs::exists('name')``, which returns a boolean.

View File

@@ -20,6 +20,24 @@ Laravel Breadcrumbs uses `Semantic Versioning <http://semver.org/>`_.
.. ================================================================================
================================================================================
v3.0.1_ :date:`(28 Aug 2016)`
================================================================================
- Laravel 5.3 support
.. _v3.0.1: https://github.com/davejamesmiller/laravel-breadcrumbs/tree/3.0.1
----------------------------------------
Upgrading from Laravel 5.2 to 5.3
----------------------------------------
- Upgrade Laravel Breadcrumbs to 3.0.1 (or above)
- Move ``app/Http/breadcrumbs.php`` to ``routes/breadcrumbs.php`` (optional but recommended)
================================================================================
v3.0.0_ :date:`(8 Feb 2015)`
================================================================================

View File

@@ -2,11 +2,13 @@
Contributing
################################################################################
.. This text is also in ../CONTRIBUTING.rst
.. NOTE: This text is also in ../README.rst
If you want to submit a **bug fix**, make your changes in a new branch, based on the ``develop`` branch, then simply open a `pull request <https://github.com/davejamesmiller/laravel-breadcrumbs/pulls>`_ on GitHub. (The information below may help you to get started if you've not done this before.)
If you want to submit a **bug fix**, please make your changes in a new branch, then open a `pull request <https://github.com/davejamesmiller/laravel-breadcrumbs/pulls>`_. (The `Contributing page of the docs <http://laravel-breadcrumbs.davejamesmiller.com/en/latest/contributing.html>`_ may help you to get started if you've not done this before.)
If you want to submit a **new feature**, it's usually best to open an `issue <https://github.com/davejamesmiller/laravel-breadcrumbs/issues>`_ to discuss the idea first -- to make sure it will be accepted before spending too much time on it. (Of course you can go ahead and develop it first if you prefer!) Please be sure to update the documentation as well.
If you want to submit a **new feature**, it's usually best to open an `issue <https://github.com/davejamesmiller/laravel-breadcrumbs/issues>`_ to discuss the idea first -- to make sure it will be accepted before spending too much time on it. (Of course you can go ahead and develop it first if you prefer!) Please be sure to include unit tests and update the documentation as well.
If you have any suggestions for improving the **documentation** -- especially if anything is unclear to you and could be explained better -- please let me know. (Or just edit it yourself and make a pull request.)
.. only:: html
@@ -28,7 +30,7 @@ If you've already got it installed, delete it from the ``vendor/`` directory and
$ rm -rf vendor/davejamesmiller/laravel-breadcrumbs
$ composer install --prefer-source
$ cd vendor/davejamesmiller/laravel-breadcrumbs
$ git checkout -t origin/develop
$ git checkout -t origin/master
$ git checkout -b YOUR_BRANCH
# Make changes and commit them
$ git remote add YOUR_USERNAME git@github.com:YOUR_USERNAME/laravel-breadcrumbs

View File

@@ -30,7 +30,7 @@ For generating the URL, you can use any of the standard Laravel URL-generation m
- ``url('path/to/route')`` (``URL::to()``)
- ``secure_url('path/to/route')``
- ``route('routename')`` (``URL::route()``)
- ``route('routename')`` or ``route('routename', 'param')`` or ``route('routename', ['param1', 'param2'])`` (``URL::route()``)
- ``action('controller@action')`` (``URL::action()``)
- Or just pass a string URL (``'http://www.example.com/'``)
@@ -64,6 +64,8 @@ This is another static page, but this has a parent link before it:
$breadcrumbs->push('Blog', route('blog'));
});
It works by calling the closure for the ``home`` breadcrumb defined above.
It would be rendered like this:
.. raw:: html
@@ -78,6 +80,8 @@ It would be rendered like this:
Home > Blog
Note that the default template does not create a link for the last breadcrumb (the one for the current page), even when a URL is specified. You can override this by creating your own template - see :doc:`templates` for more details.
================================================================================
Dynamic titles and links

View File

@@ -18,7 +18,7 @@ In normal usage you must call ``Breadcrumbs::render($name, $params...)`` to rend
Name your routes
----------------------------------------
Make sure each of your routes has a name (``'as'`` parameter). For example (``app/Http/routes.php``):
Make sure each of your routes has a name (``'as'`` parameter). For example (``routes/web.php``):
.. code-block:: php
@@ -28,14 +28,14 @@ Make sure each of your routes has a name (``'as'`` parameter). For example (``ap
// Home > [Page]
Route::get('/page/{id}', ['as' => 'page', 'uses' => 'PageController@show']);
For more details see `Named Routes <http://laravel.com/docs/routing#named-routes>`_ in the Laravel documentation.
For more details see `Named Routes <https://www.laravel.com/docs/5.3/routing#named-routes>`_ in the Laravel documentation.
----------------------------------------
Name your breadcrumbs to match
----------------------------------------
For each route, create a breadcrumb with the same name. For example (``app/Http/routes.php``):
For each route, create a breadcrumb with the same name. For example (``routes/breadcrumbs.php``):
.. code-block:: php
@@ -80,14 +80,15 @@ Laravel Breadcrumbs uses the same model binding as the controller. For example:
.. code-block:: php
// app/Http/routes.php
// routes/web.php
Route::model('page', 'Page');
Route::get('/page/{page}', ['uses' => 'PageController@show', 'as' => 'page']);
.. code-block:: php
// app/Http/Controllers/PageController.php
class PageController extends Controller {
class PageController extends Controller
{
public function show($page)
{
return view('page/show', ['page' => $page]);
@@ -96,7 +97,7 @@ Laravel Breadcrumbs uses the same model binding as the controller. For example:
.. code-block:: php
// app/Http/breadcrumbs.php
// routes/breadcrumbs.php
Breadcrumbs::register('page', function($breadcrumbs, $page)
{
$breadcrumbs->parent('home');
@@ -105,7 +106,7 @@ Laravel Breadcrumbs uses the same model binding as the controller. For example:
This makes your code less verbose and more efficient by only loading the page from the database once.
For more details see `Route Model Binding <http://laravel.com/docs/routing#route-model-binding>`_ in the Laravel documentation.
For more details see `Route Model Binding <https://www.laravel.com/docs/5.3/routing#route-model-binding>`_ in the Laravel documentation.
================================================================================
@@ -116,7 +117,7 @@ Laravel automatically creates route names for resourceful controllers, e.g. ``ph
.. code-block:: php
// app/Http/routes.php
// routes/web.php
Route::resource('photo', 'PhotoController');
.. code-block:: bash
@@ -137,7 +138,7 @@ Laravel automatically creates route names for resourceful controllers, e.g. ``ph
.. code-block:: php
// app/Http/breadcrumbs.php
// routes/breadcrumbs.php
// Photos
Breadcrumbs::register('photo.index', function($breadcrumbs)
@@ -167,29 +168,23 @@ Laravel automatically creates route names for resourceful controllers, e.g. ``ph
$breadcrumbs->push('Edit Photo', route('photo.edit', $photo->id));
});
For more details see `RESTful Resource Controllers <http://laravel.com/docs/controllers#restful-resource-controllers>`_ in the Laravel documentation.
For more details see `Resource Controllers <https://www.laravel.com/docs/5.3/controllers#resource-controllers>`_ in the Laravel documentation.
================================================================================
Implicit controllers
================================================================================
Laravel doesn't appear to support named routes in implicit controllers (tested on Laravel 5.0.2), so you will not be able to use them with route-bound breadcrumbs. For example:
To use implicit controllers, you must specify names for each route. For example:
.. code-block:: php
// app/Http/routes.php
Route::controller('users', 'UserController');
// routes/web.php
Route::controller('auth', 'Auth\AuthController', [
'getRegister' => 'auth.register',
'getLogin' => 'auth.login',
]);
.. code-block:: bash
(You don't need to provide route names for actions that redirect and never display a view - e.g. most POST views.)
$ php artisan route:list
+----------+-----------------------------------------+-----------+------------------------------+
| Method | URI | Name | Action |
+----------+-----------------------------------------+-----------+------------------------------+
| GET|HEAD | users | | UserController@getIndex |
| GET|HEAD | users/index/{one?}/{two?}/{three?}... | | UserController@getIndex |
| POST | users/profile/{one?}/{two?}/{three?}... | | UserController@postProfile |
+----------+-----------------------------------------+-----------+------------------------------+
For more details see `Implicit Controllers <http://laravel.com/docs/controllers#implicit-controllers>`_ in the Laravel documentation.
For more details see `Implicit Controllers <https://www.laravel.com/docs/5.1/controllers#implicit-controllers>`_ in the Laravel documentation.

View File

@@ -40,7 +40,7 @@ Add the service provider to ``providers``:
'providers' => [
// ...
'DaveJamesMiller\Breadcrumbs\ServiceProvider',
DaveJamesMiller\Breadcrumbs\ServiceProvider::class,
],
And add the facade to ``aliases``:
@@ -49,7 +49,7 @@ And add the facade to ``aliases``:
'aliases' => [
// ...
'Breadcrumbs' => 'DaveJamesMiller\Breadcrumbs\Facade',
'Breadcrumbs' => DaveJamesMiller\Breadcrumbs\Facade::class,
],
@@ -57,7 +57,7 @@ And add the facade to ``aliases``:
2. Define your breadcrumbs
================================================================================
Create a file called ``app/Http/breadcrumbs.php`` that looks like this:
Create a file called ``routes/breadcrumbs.php`` that looks like this:
.. code-block:: php
@@ -106,7 +106,7 @@ See the :doc:`defining` section for more details.
3. Choose a template
================================================================================
By default a `Bootstrap <http://getbootstrap.com/components/#breadcrumbs>`_-compatible unordered list will be rendered, so if you're using Bootstrap 3 you can skip this step.
By default a `Bootstrap <http://getbootstrap.com/components/#breadcrumbs>`_-compatible ordered list will be rendered, so if you're using Bootstrap 3 you can skip this step.
First initialise the config file by running this command:

View File

@@ -20,9 +20,9 @@ To customise the HTML, create your own view file (e.g. ``resources/views/_partia
<ul class="breadcrumb">
@foreach ($breadcrumbs as $breadcrumb)
@if (!$breadcrumb->last)
<li><a href="{{{ $breadcrumb->url }}}">{{{ $breadcrumb->title }}}</a></li>
<li><a href="{{ $breadcrumb->url }}">{{ $breadcrumb->title }}</a></li>
@else
<li class="active">{{{ $breadcrumb->title }}}</li>
<li class="active">{{ $breadcrumb->title }}</li>
@endif
@endforeach
</ul>
@@ -41,11 +41,11 @@ The view will receive an array called ``$breadcrumbs``.
Each breadcrumb is an object with the following keys:
- ``title`` - The title you set above
- ``url`` - The URL you set above
- ``title`` - The breadcrumb title (see :doc:`defining`)
- ``url`` - The breadcrumb URL (see :doc:`defining`), or ``null`` if none was given
- ``first`` - ``true`` for the first breadcrumb (top level), ``false`` otherwise
- ``last`` - ``true`` for the last breadcrumb (current page), ``false`` otherwise
- Additional keys for each item in ``$data`` (see :ref:`custom-data`)
- Plus additional keys for each item in ``$data`` (see :ref:`custom-data`)
================================================================================
@@ -56,4 +56,5 @@ Then update your config file (``config/breadcrumbs.php``) with the custom view n
.. code-block:: php
// resources/views/_partials/breadcrumbs.blade.php
'view' => '_partials/breadcrumbs',

View File

@@ -19,6 +19,8 @@ class Manager {
public function register($name, $callback)
{
if (isset($this->callbacks[$name]))
throw new Exception("Breadcrumb name \"{$name}\" has already been registered");
$this->callbacks[$name] = $callback;
}

View File

@@ -67,8 +67,14 @@ class ServiceProvider extends BaseServiceProvider {
// This method can be overridden in a child class
public function registerBreadcrumbs()
{
// Load the app breadcrumbs if they're in app/Http/breadcrumbs.php
if (file_exists($file = $this->app['path'].'/Http/breadcrumbs.php'))
// Load the app breadcrumbs if they're in routes/breadcrumbs.php (Laravel 5.3)
if (file_exists($file = $this->app['path.base'].'/routes/breadcrumbs.php'))
{
require $file;
}
// Load the app breadcrumbs if they're in app/Http/breadcrumbs.php (Laravel 5.0-5.2)
elseif (file_exists($file = $this->app['path'].'/Http/breadcrumbs.php'))
{
require $file;
}

View File

@@ -2,17 +2,17 @@
abstract class TestCase extends Orchestra\Testbench\TestCase {
protected function getPackageProviders()
protected function getPackageProviders($app)
{
return [
'DaveJamesMiller\Breadcrumbs\ServiceProvider',
DaveJamesMiller\Breadcrumbs\ServiceProvider::class,
];
}
protected function getPackageAliases()
protected function getPackageAliases($app)
{
return [
'Breadcrumbs' => 'DaveJamesMiller\Breadcrumbs\Facade'
'Breadcrumbs' => DaveJamesMiller\Breadcrumbs\Facade::class
];
}

View File

@@ -2,10 +2,10 @@
class CustomServiceProviderTest extends TestCase {
protected function getPackageProviders()
protected function getPackageProviders($app)
{
return [
'CustomServiceProvider',
CustomServiceProvider::class,
];
}

View File

@@ -2,12 +2,12 @@
class DependantServiceProviderErrorTest extends TestCase {
protected function getPackageProviders()
protected function getPackageProviders($app)
{
return [
// These are in the wrong order
'DependantServiceProviderError',
'DaveJamesMiller\Breadcrumbs\ServiceProvider',
DependantServiceProviderError::class,
DaveJamesMiller\Breadcrumbs\ServiceProvider::class,
];
}

View File

@@ -2,11 +2,11 @@
class DependantServiceProviderTest extends TestCase {
protected function getPackageProviders()
protected function getPackageProviders($app)
{
return [
'DaveJamesMiller\Breadcrumbs\ServiceProvider',
'DependantServiceProvider',
DaveJamesMiller\Breadcrumbs\ServiceProvider::class,
DependantServiceProvider::class,
];
}

View File

@@ -38,18 +38,19 @@ class CurrentRouteTest extends TestCase {
$this->call('GET', '/sample/blah/object');
}
/**
* @expectedException DaveJamesMiller\Breadcrumbs\Exception
* @expectedExceptionMessage The current route (GET /sample/unnamed) is not named - please check routes.php for an "as" parameter
*/
/**
* @expectedException DaveJamesMiller\Breadcrumbs\Exception
* @expectedExceptionMessage The current route (GET /sample/unnamed) is not named - please check routes.php for an "as" parameter
*/
public function testUnnamedRoute()
{
Route::get('/sample/unnamed', function()
{
$this->assertSame(['sample', []], $this->currentRoute->get());
$this->currentRoute->get();
});
$this->call('GET', '/sample/unnamed');
// Laravel 5.3+ catches the exception
throw $this->call('GET', '/sample/unnamed')->exception;
}
public function testSet()

View File

@@ -3,17 +3,17 @@
@foreach ($breadcrumbs as $breadcrumb)
@if ($breadcrumb->last)
<li class="active">
{{{ $breadcrumb->title }}}
{{ $breadcrumb->title }}
</li>
@elseif ($breadcrumb->url)
<li>
<a href="{{{ $breadcrumb->url }}}">{{{ $breadcrumb->title }}}</a>
<a href="{{ $breadcrumb->url }}">{{ $breadcrumb->title }}</a>
<span class="divider">/</span>
</li>
@else
{{-- Using .active to give it the right colour (grey by default) --}}
<li class="active">
{{{ $breadcrumb->title }}}
{{ $breadcrumb->title }}
<span class="divider">/</span>
</li>
@endif

View File

@@ -2,9 +2,9 @@
<ol class="breadcrumb">
@foreach ($breadcrumbs as $breadcrumb)
@if ($breadcrumb->url && !$breadcrumb->last)
<li><a href="{{{ $breadcrumb->url }}}">{{{ $breadcrumb->title }}}</a></li>
<li><a href="{{ $breadcrumb->url }}">{{ $breadcrumb->title }}</a></li>
@else
<li class="active">{{{ $breadcrumb->title }}}</li>
<li class="active">{{ $breadcrumb->title }}</li>
@endif
@endforeach
</ol>