Multiple Layouts In Laravel Blade, Vue-Router
I am trying to separate user & admin functionality but can't find a satisfactory solution.
After login, the user is authenticated and then he is redirected to either user or admin blade view depending upon the role.
"Now, in the
user.blade file, I just want to load user-related routes & components and vice versa. This way, I won't need any ACL in Vue-router and extra fuss, I guess".
But how do I make this work? I have searched everywhere but can't find a proper solution...
You could create 3 different JS files, like
vendor.js for e.g. Vue and other libraries,
app.js for the user area and
admin.js for the admin area.
user.blade.php you include
app.js and in
admin.blade.php you include
app.js will include all routes for the normal user, while
admin.js will include all routes/components etc for the admin area.
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?