I have a route that is dependent on 2 parameters:
Route::get('{place}/{treatment}', 'ClinicController@showResults')->name('clinic.search.results');
I am wanting to show the breadcrumb of this result as:
Home -> {Place} -> {Treatment}
But preferably, "place" should not be linked to anything as I haven't set up a route to handle "place" only. It returns a 404.
I have it set up within breadcrumbs.php
as:
Breadcrumbs::register('clinic.search.results', function ($breadcrumbs, $place, $treatment) {
$breadcrumbs->parent('location', $place);
$breadcrumbs->push($treatment, route('clinic.search.results', $place, $treatment));
});
But an exception is thrown:
Type error: Too few arguments to function DaveJamesMiller\Breadcrumbs\BreadcrumbsServiceProvider::{closure}(), 1 passed in /home/vagrant/compare/vendor/davejamesmiller/laravel-breadcrumbs/src/BreadcrumbsGenerator.php on line 68 and exactly 3 expected (View: /home/vagrant/resources/views/clinic/search/results.blade.php)
What am I missing please? Thank you in advance.