vendredi 20 novembre 2015

Send $varaible to a view in Laravel 5

I have an $alert variable array. I want to send it from my controller to my view.

I've tried this

controller

return Redirect::to('/account/'.$id) ->with('alerts',$alerts)

Route

My route : http://localhost:8888/account/1007

View

I tried accessing like this

{!!$alerts!!}

Then, I tried accessing it like this, but I kept getting

Undefined variable: alerts



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire