thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

Customize "setting tabs" for admin & developers #3162

Open aozen opened 6 years ago

aozen commented 6 years ago

Description:

Hello awesome people. I have a question about settings section. In here, we can set our configurations by default "site" and we can add more tabs. Think about i have "admin" tab. Site tab for admins, "admin" tab for developers. Developers can saw 2 tab. But admins can just saw "site" tab. How can we do that easily? I made this once time previously project, but it didn't seem a cool solution and has a lot of bugs. If there no such a thing like that. I can write better solutions and i can publish with voyager team. I think this is a very important thing.

emptynick commented 6 years ago

If you want to have a solution for you, you can write your own Policy to exclude/include things for roles. If you want a solution at the core, this could be a many-to-many relationship between roles and settings-group

YounessTayer commented 6 years ago

Hi, this is an interesting idea, will be great if somebody can make a tutorial to explain on how to do this. I am struggling to solve a quit similar problem I described here.

aozen commented 6 years ago

This is working for me right now. But warning, there could be bugs, missing somethings. I don't improve yet.

in the settings/index.php go to row 218 change inside the

fletch3555 commented 6 years ago

please, Please, PLEASE! don't change any files under vendor/. They are package-controlled and will be overwritten when you upgrade next.

You're free to copy that file to your project (following the Overriding Views section in our docs) and edit it to your heart's content.

aozen commented 6 years ago

@fletch3555 Thank you for the advice. But i changed this in resources/views/vendor/voyager/settings/index if an error exist in future time, i will remove this safely.