Answer the question
In order to leave comments, you need to log in
Where to store your own libraries?
Hello!
Interested in the issue of storing your own libraries in a laravel project. For example, I wrote classes for working with the VK API, the Odnoklassniki API, and I want to use them in the project. Where to put class files?
laravel 5.4+
Answer the question
In order to leave comments, you need to log in
I do this, create a folder /app/Supports
and store parts of the project there as packages. For example like this:
/app/Supports
/Cart
/Facades
CartFacade.php
Cart.php
ServiceProvider.php
/config/app.php
.
By the principle of symphony, you can create a src directory and add individual agnostic pieces there, connecting them with a composer (repository type: path). If the piece is not self-contained, then it makes sense to use a service layer: app/Services, for example.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question