chris-ware / nova-breadcrumbs

Breadcrumbs for Laravel Nova
152 stars 44 forks source link

Per-resource custom breadcrumb and minor tweaks #130

Closed RobertoNegro closed 2 years ago

RobertoNegro commented 2 years ago

Hello, I've changed some stuff in the package:

  1. Now we have Nova 4, so I've changed the version to ^3.0 instead of >=3. This is because I don't think this library has been tested with Nova 4, and I think that it's better to show a compatibility issue between the dependencies from composer when upgrading to Nova 4, so that if someone has a license for Nova 4 can eventually change it to ^3.0|^4.0 after testing this package with the newer version of nova.
  2. Added auth.json to gitignore, since it can be used for the license of nova if not configured globally
  3. I've removed the serializeWithId method from the trait since it was not used anywhere
  4. Added the possibility to remove the resource class link or resource instance link from the breadcrumb by returning false from breadcrumbResourceLabel() or breadcrumbResourceTitle() (potentially could solve #126 by adding some policy check on those methods and eventually returning false if the user is not allowed?)
  5. Added the possibility to add custom breadcrumbs per-resource. To do so, one can simply override customBreadcrumbs and add some items. Those are visualized between the breadcrumbResourceLabel and the breadcrumbResourceTitle. In my case, I've used it to provide a breadcrumb showing the full hierarchy of models in a nested-set.
chris-ware commented 2 years ago

@RobertoNegro

1 - I agree, but I've been hesitant to do this as it just means this newer tag isn't installed, rather than the entire package, or I'd have to drop every other tag with the original constraint.

2 - I didn't consider that, if developing standalone, there is a possibility for this, so that's a good shout, but fairly minor.

3+4 - I'm hestitant to merge these for several reasons. Firstly, they allow for the possibility of more complication when issues are reported, and as I'm limited in my support of this package due to the fact I only now have access to one project that runs this package personally, and as such I don't have much need or time to maintain it or test new issues as they arise. Secondly, I still would eventually like to make a version 3 at some point, details of which can be found in the projects tab, which would completely overhaul how breadcrumbs are generated by allowing for customisation per resource via defining a customised manager for the request URLs passed from Nova. Finally, with Nova 4 not having support for Vue component overwrites yet (supposedly coming at some point soon), and a large amount of the community shifting to that, there is no need to maintain it whilst it won't actually work, plus the project that I have access to has no intention of updating to Nova 4 any time soon, as there is no need.

I'll leave the PR open for now, to allow a bit more time for consideration, but I'm making no promises.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed because it has not had recent activity.