dimanche 10 décembre 2017

How to access passed data inside a redirect route from blade template

I have a method that redirect to a route like this with a data passed inside it:

return redirect('vendors')->with('vendor',$allvendors);

and i want to access the data that i passed from a blade template that the redirect is pointing to, so i did something like this:

@foreach($vendor as $vendors)

but i am getting this error:

Undefined variable: vendor (View: /opt/lampp/htdocs/easyhire-web/resources/views/vendor/vendors.blade.php)

I rely don't know what i am doing wrong, but when i return a view with that same data, it will work but if i change it to redirect, it will give error. any help out there?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire