Breadcrumbs Facade

for

/**
 * Register a new breadcrumb.
 *
 * @param string $name
 * @param callable $callback
 * @return void
 */
Breadcrumbs::for(string $name, callable $callback): void;

before

/**
 * Register a breadcrumb to be rendered before every breadcrumb.
 *
 * @param callable $callback
 * @return void
 */
Breadcrumbs::before(callable $callback): void;

exists

/**
 * Check if a breadcrumb exists.
 * Omit name to check if a breadcrumb exists for the current route.
 *
 * @param string|null $name
 * @return bool
 */
Breadcrumbs::exists(string $name = null): bool;

generate

/**
 * Generate breadcrumbs for the given registered breadcrumb, or the current route.
 *
 * @param string|null $name
 * @param ...$params
 * @return \Illuminate\Support\Collection
 */
Breadcrumbs::generate(string $name = null, ...$params): Collection;

view

/**
 * Render a registered breadcrumb using the given view.
 *
 * @param string $view
 * @param string|null $name
 * @param ...$params
 * @return string
 */
Breadcrumbs::view(string $view, string $name = null, ...$params): string;

render

/**
 * Render a registered breadcrumb.
 *
 * @param string|null $name
 * @param ...$params
 * @return string
 */
Breadcrumbs::render(string $name = null, ...$params): string;

current

/**
 * Retrieve the breadcrumb for the current page.
 *
 * @return object|null
 */
Breadcrumbs::current(): ?object;

setCurrentRoute

/**
 * Manually override the current route.
 *
 * @param string $name
 * @param ...$params
 * @return \Rawilk\Breadcrumbs\Breadcrumbs
 */
Breadcrumbs::setCurrentRoute(string $name, ...$params): \Rawilk\Breadcrumbs\Breadcrumbs;

clearCurrentRoute

/**
 * Clear the current route from Breadcrumbs.
 *
 * @return \Rawilk\Breadcrumbs\Breadcrumbs
 */
Breadcrumbs::clearCurrentRoute(): \Rawilk\Breadcrumbs\Breadcrumbs;

macro

/**
 * Register a custom macro.
 *
 * @param string $name
 * @param object|callable $macro
 * @return void
 */
Breadcrumbs::macro(string $name, callable $macro): void;
← Previous Topic

Custom Classes

Next Topic →

Generator

Caught a mistake? Suggest an edit on Github