How can I pass parameter using dynamic breadcrums

2019-09-03 05:21发布

问题:

My breadcrumbs view like this :

Home / Dashboard / Summary / Summary Detail

If link summary detail is active, the url link like this :

http://my-app.test/admin/summary-detail?item_number=123&vendor_code=V123&from_date=2018-01-01&to_date=2018-08-01

If I click link summary, the url like this :

http://my-app.test/admin/summary

I want if I click link summary, it will get all parameter from summary detail. So I want the url like this :

http://my-app.test/admin/summary?item_number=123&vendor_code=V123&from_date=2018-01-01&to_date=2018-08-01

How can I do it?

Note

I use dynamic breadcrumbs

documentation : https://github.com/davejamesmiller/laravel-breadcrumbs

In my \routes\breadcrumbs\summary.php like this :

<?php
Breadcrumbs::for('admin.summary.index', function ($trail) {
    $trail->parent('admin.dashboard');
    $trail->push(__('Summary'), route('admin.summary.index'));
});
Breadcrumbs::for('admin.summary-detail.index', function ($trail) {
    $trail->parent('admin.summary.index');
    $trail->push(__('Summary Detail'), route('admin.summary-detail.index'));
});

I using {!! Breadcrumbs::render() !!} in view blade to get it

My routes like this :

Route::resource('summary', 'SummaryController');
Route::resource('summary-detail', 'SummaryDetailController');