-
-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[8.0] Add breadcrumbs to a route entry #1073
Comments
It seems that the author of the used package for breadcrumbs will no longer support and develop it. I think that we can accept its achievements and use them on our own. For us, there is no need to fully reproduce all the functionality including various display themes, therefore I propose a minimal set: // Checks if data for the current/transmitted route
Breadcrumbs::has();
Breadcrumbs::has('dashboard.index');
// Get collection for route
Breadcrumbs::get(); With usage examples: @foreach (Breadcrumbs::get() as $crumbs)
@if ($crumbs->url() && !$loop->last)
<li class="breadcrumb-item">
<a href="{{ $crumbs->url() }}">
{{ $crumbs->title() }}
</a>
</li>
@else
<li class="breadcrumb-item active">
{{ $crumbs->title() }}
</li>
@endif
@endforeach |
It is also worth immediately adding support for short functions. Route::get('/about')->name('about')->breadcrumbs(fn ($trail) =>
$trail->parent('home')->push('About')
)); |
tabuna
added a commit
that referenced
this issue
Apr 23, 2020
Closed
tabuna
added a commit
that referenced
this issue
Jun 4, 2020
tabuna
added a commit
that referenced
this issue
Jun 4, 2020
tabuna
added a commit
that referenced
this issue
Jun 25, 2020
tabuna
added a commit
that referenced
this issue
Jun 26, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I am always a little upset when you need to find and change bread crumbs for several routes. Due to the fact that they are indifferent files and are not related to each other. Therefore, you must first open the file with the routes to see the name of the route, then open another and find a match in it.
This is not a problem when there are few routes, but when there are many in your application and there are breadcrumbs for everyone, it starts to bother.
Describe the solution you'd like
My suggestion is very simple - combine the announcement of routes and breadcrumbs.
As you can see, we have lost the duplicate required parameter name.
Describe alternatives you've considered
Wait until such functionality appears in the dependent package.
Or expect a similar solution in another package dwightwatson/breadcrumbs
Additional context
I added a
breadcrumbs
branch with this featureThe text was updated successfully, but these errors were encountered: