0

I want to remove the links in breadcrumbs how do I do that? Currently using this package to do it, davejamesmiller/laravel-breadcrumbs.

Is it possible to remove the links?

For now I have something like this:
// Summary
Breadcrumbs::register('summary', function ($breadcrumbs) {
    $breadcrumbs->push('List of Applicant', route('summary'));
});


// Summary > User Information
Breadcrumbs::register('user.show', function ($breadcrumbs,$id) {
    $breadcrumbs->parent('summary', route('summary'));
    $breadcrumbs->push('User Information', route('user.show', $id));
});

So I want to remove the link part for Summary when I am in the page of User Information, how do I do that? Example just plain text, Summary > User Information

Dkna
  • 409
  • 3
  • 15
  • 37
  • did you tried to leave the url in blank? – Jared Chu Jan 03 '18 at 03:42
  • What do you mean by leaving the url in blank? Do you mean inside the blade, remove the breadcrumb? – Dkna Jan 03 '18 at 03:45
  • I mean `$breadcrumbs->push('List of Applicant', '');` – Jared Chu Jan 03 '18 at 03:49
  • Oh yes, that was what I wanted, thank you so much I actually tried doing something like yours just now but I took out the wrong part. So sorry for the dumb question here – Dkna Jan 03 '18 at 03:54
  • Also you can use php code to generate dynamic breadcrumb [here](https://stackoverflow.com/questions/37966729/laravel-dynamic-breadcrumbs-with-links) – Rohan Khude Feb 20 '18 at 14:14

1 Answers1

1

For push() only mandatory param is title, so if you want to remove URL from a breadcrumb you can do like this:

$breadcrumbs->push('User Information');

Roshin
  • 91
  • 1
  • 8