r/laravel•
inxilpro

Just released version 1.0 of Gretel, a Laravel breadcrumb package aimed at easy configuration, accessibility, and CSS framework flexibility

Gretel aims to make adding accessible breadcrumbs to your Laravel application a breeze. You define breadcrumbs directly alongside your routes, and display them using a Blade component.

Route::get('/users/create', 'UserController@create')
  ->name('users.create')
  ->breadcrumb('Add a User'. 'users.index'); // title, parent

Gretel supports most major CSS frameworks out of the box:

  • Tailwind
  • Materialize
  • Bootstrap (3, 4, and 5)
  • Bulma
  • Semantic UI
  • Primer
  • Foundation (5 and 6)
  • UIKit

And also makes it easy to use your own Blade view while still getting accessibility concerns like the aria-label and aria-current attributes right.

Check it out: glhd/gretel

And any feedback is welcome!

Posted Sep 28, 2021, 4:24 PM UTC

113
frankieeedeee•

Really nice!! Thanks for sharing! Interested to know how the caching mechanism works, especially with the use of closures in the Breadcrumb definitions… My understanding was that closures couldn’t be used when caching routes? I.e php artisan route:cache 🙂

1
inxilproOP•

Under the hood it uses opis/closure to serialize the closures when you cache the breadcrumbs, and then unserialize them as needed. Laravel started using the same package a while ago to lift the constraint on closures in routes (and also uses it for closures in the queue/etc).

1
filthy_peasant79•

This is awesome! Thanks

1