Last Updated: February 25, 2016
·
363
· dieter coopman

Laravel, passing variables the quick way

instead of using

View::make('yourview')->with(array("variable1" => $variable1, "variable2" => $variable2));

you can use

View::make('yourview')->with(compact('variable1','variable2'));

... faster coding ...

1 Response
Add your response

Or

~~~
View::make('yourview',compact('variable1','variable2'));
~~~

over 1 year ago ·