v7.0.0
Chainable calls are here! Combined with arrow functions in PHP 7.4, you can now use the following elegant syntax:
<?php
use Diglactic\Breadcrumbs\Breadcrumbs;
use Diglactic\Breadcrumbs\Generator as BreadcrumbTrail;
Breadcrumbs::for(
'post',
fn (BreadcrumbTrail $trail, Post $post) => $trail
->parent('blog')
->push($post->title, route('post', $post))
);
Thanks to @tabuna for the original PR.
7.x
also introduces some breaking housekeeping changes. Take a moment to review the upgrade guide.