Closed bitserve-jelle closed 3 years ago
Can you remove the SpecificModel
typing and dd($modelInstance)
? It sounds like this exception is saying $modelInstance
is coming in as an array which means route-model binding might not be working at the controller level.
If dumping $modelInstance
indeed resolves to a model, then this a problem with the package.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Hi, excuse me for my response being late. I just saw your response. I think it was an issue due to Livewire. For this the SubstituteBinding middleware might not be able to determine the proper Model instances due to a different structure. Livewire itself seems to be able to do the substitution, but that one came later than my method call.
Hm, I haven't used Livewire myself, so I'm not much help here. This might be related? https://github.com/livewire/livewire/issues/2558 It doesn't seem to line up with your original stack trace, but you're more than welcome to:
Breadcrumbs::for('specificRoute', function (BreadcrumbTrail $trail, string $modelKey) {
$resolvedModel = SomeModel::findOrFail($modelKey);
});
if needed.
If you end up opening an issue with Livewire, please link that here.
When` I try to do this (SpecificModel can be any type):
I get this error:
Could anyone tell me how to fix this? This template is explicitly given as an option in the README if I am not mistaken.