Download the PHP package aelora/laravel-breadcrumbs without Composer

On this page you can find all versions of the php package aelora/laravel-breadcrumbs. 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

Latest Version on Packagist Total Downloads

Quickly build breadcrumb trails for your pages in Laravel and automatically output the HTML and JSON-LD schema metadata.

Installation

You can install the package via composer:

You can publish the config file with:

This is the contents of the published config file:

Optionally, you can publish the views using

Currently the only two views are jsonld.blade.php which is used for the Schema metadata and breadcrumbs-tailwind.blade.css.

Usage

You can also call $breadcrumbs->generate() for the same effect. Breadcrumbs implements Stringable and has a __toString() method, so you don't need to. The __toString() calls generate().

Note that we're using {!! and !!} instead of {{ and }}. We don't want the contents of the breadcrumbs to be escaped.

Home Page

You don't need to explicitly add your home page to the breadcrumbs. With the default config, it will be added automatically as the first element before output. If you don't want to include the home page link you can set home.include to false in the config file or call setHome(false) when you're creating the breadcrumbs.

Methods

public function add(string $title, string $url = '', string $image = '')

Adds a new breadcrumb link on the end of the current stack.

The only required parameter is $title. Breadcrumbs will only be links if $url is not empty. If it is, $title will display unlinked. $image is a link to an image for the breadcrumb. It's currently only used in the schema metadata and not in the visible HTML output, although it could be if you build your own view.

public function count()

Returns the number of breadcrumb items, not counting the home link.

public static function create()

Returns a new instance so you can build on one line without having to call new Breadcrumbs().

public function generate($echo = false)

Returns the generated breadcrumbs, both the visible HTML and schema metadata. If $echo is true then the breadcrumbs will also be echoed prior to return.

public function reset()

Clears the breadcrumb trail.

public function reverse()

Reverses the internal breadcrumb trail. Sometimes it's easier to build the trail backwards and then flip it at the end.

public function setHome($title, string $url = '', string $image = '')

Allows you to change the home link for individual pages without having to change the config file. Parameters are the same as the add method.

If $title is false then the home link will not be included. Otherwise it should be a string.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-breadcrumbs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/laravel-package-tools Version ^1.9.2
illuminate/contracts Version ^9.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 aelora/laravel-breadcrumbs contains the following files

Loading the files please wait ....