I\'ve written a simple display_messages()
function that will search Session::get(\'errors\')
for flash data and echo it to the screen.
Where do
I used this tutorial and i think is the easiest method: http://laravel-recipes.com/recipes/50/creating-a-helpers-file
Then either load it at the bottom of app\start\global.php as follows.
// at the bottom of the file require app_path().'/helpers.php';
Or change your composer.json file and dump the autoloader.
{
"autoload": {
"files": [
"app/helpers.php"
]
}
}
$ composer dump-auto
then you can write your functions in helpers.php and call them from anywhere
function myfunction($result){
return $result;
}