J
J
juan_chikatilo2022-03-29 22:41:59
Laravel
juan_chikatilo, 2022-03-29 22:41:59

How to distinguish between admin panel and site on laravel + vue?

Hello!
I am making an online store website. All incoming routes first go to laravel's web.php

Route::get('/{any}',function(){
return view('index');
})->where('any','.*');

Here it turns out index.blade.php is rendered
<body>
<div id="app">             
<header-component></header-component>
<categorybar-component></categorybar-component>
<router-view></router-view>
<footer-component></footer-component>
</div>
<script src="{{asset('./js/app.js')}}"></script>
</body>

Well, according to the given route, router.js already renders data
const routes=[
    {
        path:"/",
        name: 'Home',
        component: () => import('./views/index.vue')
    },
    {
        path:"/about",
        name: 'About',
        component: () => import('./views/navbar/about.vue')
    },
    {
        path:"/auth",
        name:'auth',
        component: () => import('./views/registrationANDSign/auth.vue')
    },
..................


Now I want to understand how to render for the admin panel not index.blade.php, but some other one (let's say admin.blade.php) where there will be its own header, main content, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2022-03-30
@Sanes

If everything is different, then build a separate application and add a second route to Laravel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question