S
S
Sergey Zhukov2017-01-22 00:35:46
Laravel
Sergey Zhukov, 2017-01-22 00:35:46

How do you separate frontend admins in Laravel?

Greetings!
I am a yii2 developer, I want to feel Laravel . And then everyone praises until you touch it yourself. you won't understand. Yii2
has a ready-made split version for the frontend and backend. Made as two completely different applications. Everything is great, except that in such a division, only one problem occurs with downloading files from the admin panel. It should be visible both in the admin panel and on the site. And the frontend and backend are in different folders. I solved the problem with nesting one web folder into another. Well, the root of the site at the admin was /web/ for the domain, and at the frontend /web/public/ for another domain.
A little perverse, but without duplicating files when uploading.
How do you separate such cases in Lravel ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrzej Wielski, 2017-01-22
@wielski

Admin controllers in /app/Http/Controllers/Admin
Separate authorization in /app/Http/Controllers/Admin/Auth Admin
routes in a separate file, in a group:

Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => ['auth', 'permission:use-admin-panel', 'crsf']], function() {
        Route::get('/', ['as' => 'admin.dashboard', 'uses' => '[email protected]']);
});

For divisions of access I use Entrust.
View with the following structure: https://toster.ru/answer?answer_id=943992#comments...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question