Answer the question
In order to leave comments, you need to log in
Laravel 5.4. How to make the logic of the formation of breadcrumbs correctly?
Hello, I'm using a simple breadcrumbs package . I created a separate base controller, from which the rest are inherited, set in the constructor:
public function __construct()
{
$this->breadcrumbs = new \Creitive\Breadcrumbs\Breadcrumbs;
$classes = array('breadcrumb', 'breadcrumb-item');
$this->breadcrumbs->addCssClasses($classes);
$this->breadcrumbs->setDivider('');
$this->breadcrumbs->addCrumb('Home', route('home'));
}
public function index(Request $request)
{
//...
$this
->breadcrumbs
->addCrumb('Posts', '');
$this
->breadcrumbs
->addCrumb('Post'.$request->post_id, route('post',['ost_id'=>$request->ost_id]));
//...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question