Cannot pass full array from controller in laravel to a view using redirect()

I am unable to solve passing of array issue

below is my function in controller

public function fetchData($id)
{
$id=base64_decode(urldecode($id));
prod_detail=ProductDetail::select('prod_id','supplier_id','price','open_stock','discount_rate','min_order_level')->where('prod_id','=',$id)->get();
return redirect()->route('prod_d_view', compact($prod_detail));
}

below is my route

Route::get('/product_view', function(){
return view('/admin/product_d_mgt');
})->name('prod_d_view');

below is my error

Undefined variable: prod_detail (View: \admin\product_d_mgt.blade.php)

I am unable to pass the full array from one controller using redirect()->route() to another view



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2A1pnxb
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time