DEV Community

Samson Adesanoye
Samson Adesanoye

Posted on

7

How to override a Voyager View

Voyager comes with BREAD (Browse Read Edit Add Delete) functionality right out of the box with elegant admin dashboard, situation may happen that you may want to serve the BREAD with something juicy apart from the default Voyager template.

In this article I will work you through creating your own custom Edit Add View, by default Voyager make use of just one Edit Add View file located in vendors/tcg/voyager/resources/views/bread/edit-add.blade.php.

Let say we want to override the Edit Add view for the cities (BREAD) table we created:

  1. Create a folder called vendor in your views folder
  2. Create a folder called voyager in your vendor folder
  3. Create a folder for that BREAD in our example its cities folder
  4. Create a new file edit-add.blade.php
  5. Create a new HTML Heading element in edit-add.blade.php saying “override works”.
  6. Copy the default edit-add.blade.php into the new created edit-add.blade.php to make editing fast

Your folder structure will look like this
Alt Text

This is also applicable to other views also.

Sources:

Overriding BREAD Views

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (2)

Collapse
 
mohamed_elsaidy_08dcead04 profile image
Mohamed Elsaidy

how can i get the view of voyager dashboard like if i want to edit colors of menu sidebar or navbar

Collapse
 
kingzamzon profile image
Samson Adesanoye

My apologies that it coming late
To get the voyager dashboard : In the views folder create vendor -> voyager -> index.blade.php

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay