Voyager 2
2.x
2.x
  • Introduction
  • Javascript
  • Media Manager
  • Plugins
  • Settings
  • bread
    • Actions
    • BREAD Builder
    • Layouts
    • Lists
    • Manipulate data
    • Multilanguage
    • Relationships
    • Validation
    • Views
  • contributing
    • Assets
    • CSS
    • Introduction
  • de
    • index
  • formfields
    • Checkboxes
    • Date & Time
    • Dynamic input
    • Formfields
    • Media Picker
    • Number
    • Password
    • Radios
    • Relationship
    • Repeater
    • Select
    • Simple array
    • Slider
    • Slug
    • Tags
    • Text
    • Toggle
  • getting-started
    • Installation
    • Prerequisites
    • Tips and tricks
    • What is Voyager
  • overriding
    • Overriding formfields
    • Icons
  • plugins
    • Assets
    • Components
    • Features
    • Filter
    • Plugin development
    • Language
    • Menu Items
    • Custom pages
    • Preferences
    • Routes
    • Settings
    • Widgets
Powered by GitBook
On this page
  • Filters
  • Scopes
  • Computed properties
  • Getting data
  • Setting data
  • Using your computed property

Was this helpful?

  1. bread

Manipulate data

PreviousListsNextMultilanguage

Last updated 3 years ago

Was this helpful?

This page shows you various ways to manipulate the data shown in your BREADs.

Filters

Read more about filters

Scopes

You can apply a scope to every layout in a BREAD. The shows you how to implement them.

For Voyager to recognize your scope, please make sure to follow the naming convention scope[X], for example scopeActive. You can now select the scope you want to use in the layout options:

Selecting the scope for a layout

Computed properties

Computed properties allow you to display and edit properties that don't physically exist in your database.

Getting data

Setting data

Using your computed property

Now that you created an accessor (and a mutator when you want to edit/add), you can simply select your accessor in the Column dropdown.

::: info Because Voyager doesn't know which you use in combination with which , you should also apply the scope to your views to prevent users from manually setting URL parameters and using entries they are not supposed to. :::

To get the data to be shown when browsing, simply create an as described in the Laravel docs. Please be aware that an accessor has to be named get[X]Attribute (for example getFullNameAttribute) to be recognized by Voyager.

If you want to be able to edit and/or add the data of a non-existing property, you have to create a . When used in a list, an accessor is suficient. The mutator also has to follow the naming convention set[X]Attribute, for example setFullNameAttribute.

Selecting a computed property in a list
Selecting a computed property in a view
view
list
accessor
mutator
here
Laravel documentation