jeudi 19 septembre 2019

How to pass data from partial page to main laravel master pages?

I have made my navigation file a partial file because it is commonly needed in every pages. In navigation bar there are lists of categories displayed. When i click one of the categories, i want to it to display it in another pages. For that i need to send id form that navigation bar categories. I tried to send id from the navigation bar then it shows error like Missing required parameters for [Route: details] [URI: HamroBazar/details/{id}]. (View: C:\xampp\htdocs\hamrobazarfinal\resources\views\Frontend\partial\loggedinnavigation.blade.php) (View: C:\xampp\htdocs\hamrobazarfinal\resources\views\Frontend\partial\loggedinnavigation.blade.php) (View: C:\xampp\htdocs\hamrobazarfinal\resources\views\Frontend\partial\loggedinnavigation.blade.php)

Here are some code

Navigation bar code (This is the partial file)
<div class="w3layouts-breadcrumbs">
    <div class="container-fluid">
      <span class="agile-breadcrumbs">
      <span class="categories1" >All Categories<i class="fa fa-chevron-down"></i></span>   
      @foreach($categoriespostcount as $cn)
      <a href=""><span>()</span></a> 
      @endforeach
    </div>
  </div>

Web.php

Route::get('details/{id}','Detail\DetailController@details')->name('details');

Controller

 public function details($id)
    {
        dd($id);
        return view('Frontend.pages.detail.detail');
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire