jeudi 28 décembre 2017

Laravel breadcrumbs and post page

I'm using the following package for breadcrumbs : http://ift.tt/1twBDqx

The breadcrumb do wonders, and works perfectly on almost every page. Except only one. I have to display data depending on values submitted, on the same url. So I have two routes pointing to the same controller@function, one in get, one in post.
The problem is : the breadcrumb doesn't show up when form has been submitted. It shows when accessing via GET, but not via POST.

Here is the configuration :

web.php

Route::get('/app/import', 'StuffController@import')
            ->name('app.import');
Route::post('/app/import', 'StuffController@import')
            ->name('app.import.submitted');

breadcrumbs.php

Breadcrumbs::register('app.import', function ($breadcrumbs) {
    $breadcrumbs->parent('index');
    $breadcrumbs->push(trans('stuff'));
});

Additional information :
If I add at the top of the breadcrumb.blade.php view, it's not even displayed via POST route. Apparently the view isn't called.
Is there something missing in configuration ? A coworker did it months ago, I've never had to check this part.

Thank you for your help !



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire