Voyager: How do I override default blade files such as sidebar.blade.php and master.blade.php?

Created on 26 Sep 2017  路  9Comments  路  Source: the-control-group/voyager

The current documentation only shows how to override the bread views, but there isn't a way to override the other views.

What is the proper way to edit those files? Is it just editing the blade templates in tcg/voyager/resources/views directly?

question

Most helpful comment

Well the view you want to override needs to exist of course.
So if you want to override menu/admin_menu your path would be
resources/view/vendor/voyager/menu/admin_menu

All 9 comments

You cant. Why you want to ovveride them?

If you can't override any of these views, then it's not flexible at all. I want to display different sidebar menu based on different user roles. Also, I can foresee that there will be pretty extensive changes all over the admin panels in real world projects (clients might request to change the layout of the views). My biggest concern is in the future, whether I can have control over how the admin views are going to look like or not.

@davodavodavo3 is incorrect. Laravel documentation shows you how to override any package view. Our documentation is intended to supplement the laravel documentation on this topic.

I still don't get it @fletch3555 , how to implement it in voyager case

The documentation of laravel about that it's not clear for me, can you explain the step for voyager ? i wanna override sidebar view too

Thanks :D

The documentation tells you exactly how to override package views.
Just scroll down to Overriding Package Views

Okay, please tell me if im wrong sir @emptynick :

  1. I create a file for override view of voyager sidebar here : resources/view/vendor/voyager/admin_menu.blade.php
  2. What should i do next ? nothing ? number 1 should override it ?

Well the view you want to override needs to exist of course.
So if you want to override menu/admin_menu your path would be
resources/view/vendor/voyager/menu/admin_menu

Thanks sir @emptynick , you help me so much :+1:

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zzpwestlife picture zzpwestlife  路  3Comments

MikadoInfo picture MikadoInfo  路  3Comments

vaggelis2018 picture vaggelis2018  路  3Comments

craigb88 picture craigb88  路  3Comments

iwasherefirst2 picture iwasherefirst2  路  3Comments