Laravel-modules: [How to] Share Backend views / Structure Backend

Created on 4 Apr 2017  路  7Comments  路  Source: nWidart/laravel-modules

Hi,

first of all thank you for this great package!

I made some modules and encountered the problem how to share the default backend views like the sidebar or the top navigation which should be visible for all modules.

Do you have any idea whats the best way to achieve this with your package?

I thought about creating the backend by just putting the backend views (Master Layout etc.) in the global view folder of laravel and just use modules for creating the routes, the forms and other assets for some areas of the backend like the settings module etc.

Thank you in advance.

Best Regards,

CEWLBIRD

Most helpful comment

Hey @cewlbird , maybe you wanna do like this

image

use @include('module-name::path-inside-view-folder.blade-file-name')

this is how i share my back views, i hope this help you 馃憤

All 7 comments

Hello & thanks for the kind words! 馃槃

That's all up to you. You can view how I do it in AsgardCMS for inspiration.

Hey @cewlbird , maybe you wanna do like this

image

use @include('module-name::path-inside-view-folder.blade-file-name')

this is how i share my back views, i hope this help you 馃憤

Hey @nWidart, thank you, I totally forgot about it, as I was playing around with AsgardCMS a few days ago. I think I found today a good way for accomplishing the task, thanks!

Hey @zhiru, thank you, thats exactly how I am doing it right now. I made a backend module which holds all my backend related stuff like assets, views etc. and I load them the exact way like you.

I am just unsure about the assets and how to load them properly across all modules, but at the moment I am using the default mix setup (Laravel 5.4) with some customizations.

I basically load the module assets like JS or SCSS into different global files like app.scss and backend.scss. Same goes for the JS files. I also separated the vendor files and my custom ones.

So I just run npm run dev and compile a few different files, grouped by frontend and backend which means I just load one vendor-front.js as well as the app.css for the frontend. For my backend I just load the vendor-backend.js and the backend.css.

I hope thats a good way to handle the assets of all modules.
Seems like you are using an Asset package for handling assets?

Best Regards,

CEWLBIRD

Sounds like a very good way of handling assets indeed, something the current backend lacks of a bit (not compiled/concat).
It's a custom made asset manager that is currently used yeah.

I'll close the issue for now, but the discussion can continue of course. 馃槃

@nWidart i'm continuing the discussion 馃槃
Hey @cewlbird, yes i'm using a "stolz/assets", with gulp (made my on), every change I make, I publish in public, so it's being easy for use.
@cewlbird a couple of images:
image
image
image
image

With that becomes very easy for me, hahah, hope you enjoy it

Hi @zhiru, thank you for sharing this!
Seems great to me, I'm gonna have a look at this Stolz package, this could be interesting.

Best Regards,

CEWLBIRD

Was this page helpful?
0 / 5 - 0 ratings

Related issues

firebed picture firebed  路  3Comments

dagulo picture dagulo  路  3Comments

NexxusPlexx picture NexxusPlexx  路  4Comments

pawlox picture pawlox  路  4Comments

morningmemo picture morningmemo  路  3Comments