dimanche 3 janvier 2016

how we can pass multiply id in laravel

My view.blade.php code here

 <a href="{{ url('p_grid') }}/{{($cat_id)}}/{{$row->sub_id}}">

My route code here

Route::resource('p_grid', 'BasicController@p_grid');

And my BasicController code here

public function p_grid(Request $request, $id)
{   
    echo "success";
    if ($id == 1) {
        $r = DB::table('sub_category')
        ->select('*')
        ->where('cat_id', $id)
        ->where('sub_status', '1')
        ->orderBy('sub_id', 'asc')
        ->get();

        $cat_name = DB::table('category')
        ->where('cat_id', $id)
        ->get();

        $count = DB::table('products')
        ->where('sub_id', $id)
        ->count();
       return view('buy-and-sell/p_grid', compact('r','cat_name','count','id'));
    }

click on anchor tag to show this error

image upload for help



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire