chris-ware / nova-breadcrumbs

Breadcrumbs for Laravel Nova
152 stars 44 forks source link

Fix for Error Message at Resources that have no breadcrumbs trait #114

Closed behrang1981 closed 3 years ago

behrang1981 commented 3 years ago

this fixes Call to undefined method Vyuldashev\NovaPermission\Permission::breadcrumbs() {"userId":1,"exception":"[object] (Error(code: 0): Call to undefined method Vyuldashev\NovaPermission\Permission::breadcrumbs() at /Users/behrangalavi/PhpstormProjects/larabase/doc_root/vendor/chris-ware/nova-breadcrumbs/src/Http/Controllers/NovaBreadcrumbsController.php:53)

and removes empty breadcrumb container

chris-ware commented 3 years ago

@behrang1981 Looks like you've removed a couple of lines that aren't needed to be removed. Also, there isn't a need to assign the method exists variable, just run the function inline on the if, as it saves storing a variable that is only used once. Finally, please recompile for production.

I'm going to be looking to release a new update in the next few days, so will do all of the above if I get to it first.

behrang1981 commented 3 years ago

sorry must have been late i played too much around the lines now should be ok

chris-ware commented 3 years ago

I'm going to close this PR as I've implemented it a bit differently, using clearer early exist. I've also added an extra check to ensure that the resource is using the trait before it checks anything else.