You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted a special directory to override the backpack files without cluttering the resources/views/vendor directory. For example, if you want to publish a package that enhances some of the views, or provides new fields or columns.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there.
I wanted a special directory to override the backpack files without cluttering the resources/views/vendor directory. For example, if you want to publish a package that enhances some of the views, or provides new fields or columns.
Solution below ↓↓↓
The official way to override base files is using the
view_namespace
option insideconfig/backpack/base.php
:https://backpackforlaravel.com/docs/5.x/base-how-to#create-a-new-theme-child-theme
Furthermore, you can make columns, fields, buttons and filters load from a non-vendor location using the
config/backpack/crud.php
file:Operation views are loaded from the default location, unless explicitly provided:
You can overide that for the whole project using the
config/backpack/operations/reorder.php
:I assume other operation views can be configured the same.
However:
crud/inc/show_tabbed_fields.blade.php
, are loaded from the defaultcrud::
namespaceSolution
The solution should be much simpler. So, instead of juggling with namespaces and views, you can override them:
Beta Was this translation helpful? Give feedback.
All reactions