0

I have functions file.
In this file include many functions
and i want to use them in my controllers What am i do?
I use laravel 5.1

paranoid
  • 6,799
  • 19
  • 49
  • 86

1 Answers1

3

Let's say your function file is additional_functions.php, put it inside some folder like app/my_functions.

Then you need to add that file to autoload, you'll have to open composer.json and add such code:

"autoload": {
    ...
        "files": [
                   "app/my_functions/additional_functions.php"
       ]
    ...
}

After you're done, you only need to run composer dump-autoload to reload the autoload file.

Andrius
  • 5,934
  • 20
  • 28