Skip to content

Commit

Permalink
Breadcrumb completed (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
baijunyao committed Dec 31, 2019
1 parent 5ff43c2 commit 4995830
Show file tree
Hide file tree
Showing 16 changed files with 548 additions and 72 deletions.
18 changes: 17 additions & 1 deletion .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@

/**
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
* Generated on 2019-12-07 12:14:12.
* Generated on 2019-12-28 16:18:38.
*
* @author Barry vd. Heuvel <[email protected]>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
override(new \Illuminate\Contracts\Container\Container, map([
'' => '@',
'DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,
'DaveJamesMiller\Breadcrumbs\BreadcrumbsManager' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,
'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class,
'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class,
'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class,
Expand Down Expand Up @@ -203,6 +205,8 @@
]));
override(\Illuminate\Container\Container::makeWith(0), map([
'' => '@',
'DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,
'DaveJamesMiller\Breadcrumbs\BreadcrumbsManager' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,
'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class,
'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class,
'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class,
Expand Down Expand Up @@ -394,6 +398,8 @@
]));
override(\Illuminate\Contracts\Container\Container::make(0), map([
'' => '@',
'DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,
'DaveJamesMiller\Breadcrumbs\BreadcrumbsManager' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,
'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class,
'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class,
'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class,
Expand Down Expand Up @@ -585,6 +591,8 @@
]));
override(\Illuminate\Contracts\Container\Container::makeWith(0), map([
'' => '@',
'DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,
'DaveJamesMiller\Breadcrumbs\BreadcrumbsManager' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,
'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class,
'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class,
'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class,
Expand Down Expand Up @@ -776,6 +784,8 @@
]));
override(\App::make(0), map([
'' => '@',
'DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,
'DaveJamesMiller\Breadcrumbs\BreadcrumbsManager' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,
'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class,
'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class,
'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class,
Expand Down Expand Up @@ -967,6 +977,8 @@
]));
override(\App::makeWith(0), map([
'' => '@',
'DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,
'DaveJamesMiller\Breadcrumbs\BreadcrumbsManager' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,
'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class,
'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class,
'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class,
Expand Down Expand Up @@ -1158,6 +1170,8 @@
]));
override(\app(0), map([
'' => '@',
'DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,
'DaveJamesMiller\Breadcrumbs\BreadcrumbsManager' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,
'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class,
'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class,
'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class,
Expand Down Expand Up @@ -1349,6 +1363,8 @@
]));
override(\resolve(0), map([
'' => '@',
'DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,
'DaveJamesMiller\Breadcrumbs\BreadcrumbsManager' => \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,
'Facade\IgnitionContracts\SolutionProviderRepository' => \Facade\Ignition\SolutionProviders\SolutionProviderRepository::class,
'Facade\Ignition\DumpRecorder\DumpRecorder' => \Facade\Ignition\DumpRecorder\DumpRecorder::class,
'Facade\Ignition\ErrorPage\Renderer' => \Facade\Ignition\ErrorPage\Renderer::class,
Expand Down
237 changes: 236 additions & 1 deletion _ide_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 6.9.0 on 2019-12-21 11:19:38.
* Generated for Laravel 6.9.0 on 2019-12-28 16:18:35.
*
* This file should not be included in your code, only analyzed by your IDE!
*
Expand Down Expand Up @@ -15184,6 +15184,239 @@ public static function request($method)

}

namespace DaveJamesMiller\Breadcrumbs\Facades {

/**
* Breadcrumbs facade - allows easy access to the Manager instance.
*
* @method static array getCurrentRoute()
* @mixin \Illuminate\Support\Traits\Macroable
* @see BreadcrumbsManager
*/
class Breadcrumbs {

/**
* Register a breadcrumb-generating callback for a page.
*
* @param string $name The name of the page.
* @param callable $callback The callback, which should accept a Generator instance as the first parameter and may
* accept additional parameters.
* @return void
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\DuplicateBreadcrumbException If the given name has already been
* used.
* @static
*/
public static function for($name, $callback)
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
$instance->for($name, $callback);
}

/**
* Register a breadcrumb-generating callback for a page.
*
* For backwards-compatibility with v5.0.0 and below.
*
* @param string $name The name of the page.
* @param callable $callback The callback, which should accept a Generator instance as the first parameter and may
* accept additional parameters.
* @return void
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\DuplicateBreadcrumbException If the given name has already been
* used.
* @see self::for()
* @static
*/
public static function register($name, $callback)
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
$instance->register($name, $callback);
}

/**
* Register a closure to call before generating breadcrumbs for the current page.
*
* For example, this can be used to always prepend the homepage without needing to manually add it to each page.
*
* @param callable $callback The callback, which should accept a Generator instance as the first and only parameter.
* @return void
* @static
*/
public static function before($callback)
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
$instance->before($callback);
}

/**
* Register a closure to call after generating breadcrumbs for the current page.
*
* For example, this can be used to append the current page number when using pagination.
*
* @param callable $callback The callback, which should accept a Generator instance as the first and only parameter.
* @return void
* @static
*/
public static function after($callback)
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
$instance->after($callback);
}

/**
* Check if a breadcrumb with the given name exists.
*
* If no name is given, defaults to the current route name.
*
* @param string|null $name The page name.
* @return bool Whether there is a registered callback with that name.
* @static
*/
public static function exists($name = null)
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
return $instance->exists($name);
}

/**
* Generate a set of breadcrumbs for a page.
*
* @param string|null $name The name of the current page.
* @param mixed $params The parameters to pass to the closure for the current page.
* @return \Illuminate\Support\Collection The generated breadcrumbs.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\UnnamedRouteException if no name is given and the current route
* doesn't have an associated name.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\InvalidBreadcrumbException if the name is (or any ancestor names
* are) not registered.
* @static
*/
public static function generate($name = null, $params = null)
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
return $instance->generate($name, $params);
}

/**
* Render breadcrumbs for a page with the specified view.
*
* @param string $view The name of the view to render.
* @param string|null $name The name of the current page.
* @param mixed $params The parameters to pass to the closure for the current page.
* @return \Illuminate\Support\HtmlString The generated HTML.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\InvalidBreadcrumbException if the name is (or any ancestor names are) not registered.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\UnnamedRouteException if no name is given and the current route doesn't have an associated name.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\ViewNotSetException if no view has been set.
* @static
*/
public static function view($view, $name = null, $params = null)
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
return $instance->view($view, $name, $params);
}

/**
* Render breadcrumbs for a page with the default view.
*
* @param string|null $name The name of the current page.
* @param mixed $params The parameters to pass to the closure for the current page.
* @return \Illuminate\Support\HtmlString The generated HTML.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\InvalidBreadcrumbException if the name is (or any ancestor names are) not registered.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\UnnamedRouteException if no name is given and the current route doesn't have an associated name.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\ViewNotSetException if no view has been set.
* @static
*/
public static function render($name = null, $params = null)
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
return $instance->render($name, $params);
}

/**
* Get the last breadcrumb for the current page.
*
* Optionally pass a
*
* @return \stdClass|null The breadcrumb for the current page.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\UnnamedRouteException if the current route doesn't have an associated name.
* @throws \DaveJamesMiller\Breadcrumbs\Exceptions\InvalidBreadcrumbException if the name is (or any ancestor names are) not registered.
* @static
*/
public static function current()
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
return $instance->current();
}

/**
* Set the current route name and parameters to use when calling render() or generate() with no parameters.
*
* @param string $name The name of the current page.
* @param mixed $params The parameters to pass to the closure for the current page.
* @return void
* @static
*/
public static function setCurrentRoute($name, $params = null)
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
$instance->setCurrentRoute($name, $params);
}

/**
* Clear the previously set route name and parameters to use when calling render() or generate() with no parameters.
*
* Next time it will revert to the default behaviour of using the current route from Laravel.
*
* @return void
* @static
*/
public static function clearCurrentRoute()
{
/** @var \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager $instance */
$instance->clearCurrentRoute();
}

/**
* Register a custom macro.
*
* @param string $name
* @param object|callable $macro
* @return void
* @static
*/
public static function macro($name, $macro)
{
\DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::macro($name, $macro);
}

/**
* Mix another object into the class.
*
* @param object $mixin
* @param bool $replace
* @return void
* @throws \ReflectionException
* @static
*/
public static function mixin($mixin, $replace = true)
{
\DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::mixin($mixin, $replace);
}

/**
* Checks if macro is registered.
*
* @param string $name
* @return bool
* @static
*/
public static function hasMacro($name)
{
return \DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::hasMacro($name);
}

}

}

namespace Facade\Ignition\Facades {

/**
Expand Down Expand Up @@ -19180,6 +19413,8 @@ class Markdown extends \GrahamCampbell\Markdown\Facades\Markdown {}

class Lush extends \Appstract\LushHttp\LushFacade {}

class Breadcrumbs extends \DaveJamesMiller\Breadcrumbs\Facades\Breadcrumbs {}

class Flare extends \Facade\Ignition\Facades\Flare {}

class Agent extends \Jenssegers\Agent\Facades\Agent {}
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"baijunyao/laravel-support": "^1.0",
"baijunyao/laravel-upload": "^2.0",
"composer/semver": "^1.4",
"davejamesmiller/laravel-breadcrumbs": "^5.3",
"doctrine/dbal": "^2.5",
"fideloper/proxy": "^4.0",
"fukuball/jieba-php": "~0.25",
Expand Down
Loading

0 comments on commit 4995830

Please sign in to comment.