M
M
muhasa2019-09-14 00:05:58
Laravel
muhasa, 2019-09-14 00:05:58

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

1 answer(s)
A
Alexander Aksentiev, 2019-09-14
@muhasa

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 question

Ask a Question

731 491 924 answers to any question