Download the PHP package ramir1/laravel-breadcrumbs-plus without Composer

On this page you can find all versions of the php package ramir1/laravel-breadcrumbs-plus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-breadcrumbs-plus

Laravel Breadcrumbs Plus

Adds Breadcrumbs::rule() on top of diglactic/laravel-breadcrumbs — register a breadcrumb by class name (resolved through the container) instead of a closure, so the class is only instantiated when that specific breadcrumb is generated, not for every registered page on every request. The method defaults to __invoke for single-purpose classes and supports constructor dependency injection, matching how controllers work.

This started as a pull request against diglactic/laravel-breadcrumbs which wasn't merged upstream. Rather than maintaining a fork of the whole package, this is a small extension package: it requires the vanilla diglactic/laravel-breadcrumbs and points its manager-class / generator-class config hooks (already built into that package for this exact purpose) at extended Manager and Generator classes.

Installation

Laravel's package auto-discovery registers the service provider automatically. No further setup is required.

IDE type hints

render()/generate()/view() accept a [class, method] pair at runtime (see "Rendering by class directly" below), because this package swaps the bound Manager class via config('breadcrumbs.manager-class'). IDEs like PhpStorm don't follow that indirection - they read the type hints straight off Diglactic\Breadcrumbs\Breadcrumbs's docblock (?string $name), so passing an array there gets flagged even though it works correctly. Import Ramir1\BreadcrumbsPlus\Breadcrumbs instead of Diglactic\Breadcrumbs\Breadcrumbs to get a correct docblock - it's the same facade, resolving to the exact same singleton, just with accurate types:

Usage

Breadcrumbs::rule($name, $class, $method = '__invoke') behaves like Breadcrumbs::for(), except the callback is a [$class, $method] pair. $class is resolved through the Laravel container the moment the breadcrumb is actually generated (like a controller), so it can use constructor dependency injection without being instantiated on every request that merely registers it.

Registering rules from a service provider instead of routes/breadcrumbs.php

routes/breadcrumbs.php is not required. Breadcrumbs::rule() / Breadcrumbs::rules() can be called from anywhere once the container is available — including a package or module's own ServiceProvider::boot(). This is useful in a modular app where breadcrumb classes live next to the feature they belong to, rather than in one central file that has to know about every module:

Breadcrumbs::rules(array $rules) registers many rules in one call. Each entry is either a class name (defaults to __invoke) or a [$class, $method] pair, keyed by page name — same rules as rule(), just batched.

If config('breadcrumbs.files') is left at its default (routes/breadcrumbs.php) and that file doesn't exist, diglactic/laravel-breadcrumbs silently skips loading it, so nothing needs to be disabled explicitly.

Rendering by class directly, without registering a name first

render(), generate(), and view() also accept a [$class, $method] pair in place of a registered name - $method defaults to __invoke, same as rule(). This calls the class/method directly through the container, skipping the rule() registration step entirely. Useful for a one-off page whose breadcrumb isn't reused/shared under a name:

It works the same way with a custom view - e.g. the breadcrumbs::json-ld view bundled with diglactic/laravel-breadcrumbs, for structured data instead of the usual HTML list:

Inside the class, $trail->parent() accepts the same [$class, $method] form to reference an ancestor breadcrumb directly, instead of a registered name:

This complements rule() rather than replacing it - breadcrumbs reused across several pages are still worth registering under a name. It also doesn't affect route-bound rendering: Breadcrumbs::render() called with no arguments still resolves via the current route's name, which still needs a matching for()/rule() entry.

How it works

diglactic/laravel-breadcrumbs already resolves its Manager and Generator classes through the container and exposes config('breadcrumbs.manager-class') / config('breadcrumbs.generator-class') specifically so they can be subclassed for "more advanced customisations". This package's ServiceProvider sets those two config values to its own Manager (adds rule()) and Generator (resolves [class, method] callbacks) subclasses — no files from diglactic/laravel-breadcrumbs are modified or copied.

License

MIT


All versions of laravel-breadcrumbs-plus with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
diglactic/laravel-breadcrumbs Version ^10.0
laravel/framework Version ^10.0 || ^11.0 || ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ramir1/laravel-breadcrumbs-plus contains the following files

Loading the files please wait ...