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
Asked
Active
Viewed 72 times
0

paranoid
- 6,799
- 19
- 49
- 86
-
Possible duplicate of [Laravel - Calling Redirect::to() from within view](http://stackoverflow.com/questions/18846035/laravel-calling-redirectto-from-within-view) – Navnish Bhardwaj Nov 19 '15 at 10:02
-
I think that you are mistake. – paranoid Nov 19 '15 at 10:07
-
I have master functions file and i want include this file in my controllers and use that functions – paranoid Nov 19 '15 at 10:08
1 Answers
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