Answer the question
In order to leave comments, you need to log in
What is the best way to store files related to the administrative part on Laravel?
My Laravel 5.7 project has a ProductController. Files related to the administrative part, I store in the admin folder. But ProductController is used both in the admin part and in the user part. And the further, the more such files appear. Where should these files be saved?
And the second question, if you can advise articles or books on how to better organize the file structure in Laravel and in general.
I watched videos on some projects on laracast.com, they don’t care about this at all. All files in one heap. Maybe that's how it should be done.
Answer the question
In order to leave comments, you need to log in
To store files, use Storage, where you can configure different disk configurations (public, private, local, on a remote server)
https://laravel.com/docs/5.7/filesystem
I suggest for this case to make a folder for the administrator and for the user (App\Controllers\Admin\Product\ProductController.php and App\Controllers\Product\ProductController.php). Accordingly, write your implementations in them, and move the general business logic for working with Product into the ProductService service layer.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question