Sebastian asked 3 years ago
How can we add our own breadcrumbs on custom pages (using our own routes/Controllers )
1 Answers
laraship Staff answered 3 years ago
Hello Sebastian, Under each module, there is a file under the routes folder called  [module-name]_breadcrumbs.php, for example, "messaging_breadcrumbs.php", under this file you define the structure of the breadcrumbs for this module, for example

Breadcrumbs::register('discussions', function ($breadcrumbs) {
$breadcrumbs->push(trans('Messaging::module.discussion.title'), url(config('messaging.models.discussion.resource_url')));

Breadcrumbs::register('discussion_create_edit', function ($breadcrumbs) {

Breadcrumbs::register('discussion_show', function ($breadcrumbs) {
  as you can see there is a discussions menu as a child for the dashboard and another two children for the discussion module, to render the create_ediit breadcrumb you have to add the following section in the template
{{ Breadcrumbs::render('discussion_create_edit') }}