Often we may need to pass variables from server side to client for using it in a JavaScript file or in a global script. It’s possible to write JavaScript code from server side script, for example, we may use something like this: echo "<script>var userId = " . Auth::user()->id ....
→ Read MoreIn Laravel 4 there is a very nice way to bind data automatically with a view using a View Composer. View composers are callbacks or class methods that are called when a view is created. If you have data that you want bound to a given view each time that...
→ Read More