View::share(compact('flag'));
Mar 24, 2015
7
Level 3
Passing variable from included PHP file into a view
Hi guys,
Laravel noob here. I have an external PHP file for IP geolocation that I've included in my composer.json:
"files": ["resources/inc/geo.php"]
I then ran the commands "composer update" and "composer install".
Within geo.php, I set a variable $flag. How can I pass this variable to a view? Or better yet, make it available to any view in my application?
Thanks!
Please or to participate in this conversation.