I
I
ildar-meyker2021-04-04 21:57:38
Laravel
ildar-meyker, 2021-04-04 21:57:38

How to organize files when there is a public part and an admin panel?

Am I correct if I think that the best solution would be to divide the areas of responsibility as much as possible and duplicate the code to a certain extent? Or am I mistaken?

Http/
....Controllers/
........Admin/
............PostController.php
........Site/
....... .....PostController.php
....Requests/
........Admin/
............StorePostRequest.php
........... .UpdatePostRequest.php
........Site/
............StorePostRequest.php
............UpdatePostRequest.php
....Resources/
........Admin/
............PostResource.php
........Site/
............PostResource.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2021-04-05
@Sanes

Could be so. As a result, you will receive 2 applications.
I wouldn't bother with duplication. You never know what else to come up with. If you start crossing then it will be painful to refine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question