Answer the question
In order to leave comments, you need to log in
Where to put your own functions in laravel?
Guys, I recently took up Laravel, the question is this.
Let's imagine that some of the functions are provided by Laravel, some are pulled from the composer's libraries, but there are always a bunch of small functions that I implemented myself, but I don't want to drive them into a class, I also want to design them as a library, it's expensive to look for something similar, so the question arises - where Is there a place for such functions in the Laravel architecture? Is there any best practice for this?
Answer the question
In order to leave comments, you need to log in
Laravel has nothing to do with it.
composer solves this issue, or rather autoloading.
https://laravel-news.com/creating-helpers
...
"autoload": {
"files": [
"app/helpers.php"
],
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question