jeudi 12 janvier 2017

How to pass variable with response view in [Laravel 5.1]?

I am trying to pass variables with response view in laravel, but it is not allowing me to do so.
here is what i have tried so far:

return response(view('home'))->with('name','rocky');

the above method doesn't work,

the second one i tried is as follow:

return response(view('home'), ['name','rocky']);

but i don't know how to use the above one?

NOTE: i don't want to use view::make method, i want to pass variable with response method.

please help me to sort out this issue.

Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire