Manipulate data
Last updated
Was this helpful?
Last updated
Was this helpful?
This page shows you various ways to manipulate the data shown in your BREADs.
Read more about filters
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:
Computed properties allow you to display and edit properties that don't physically exist in your database.
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
.