D
D
David2019-02-06 22:10:13
Laravel
David, 2019-02-06 22:10:13

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

2 answer(s)
V
Vasyl Fomin, 2019-02-07
@fomvasss

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

V
Vlad, 2019-02-07
@Result007

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 question

Ask a Question

731 491 924 answers to any question