-
Which's the correct way to get the voyager data from the DB? Honestly, I can't find any documentation about it.1. Getting manually using Model (Laravel Eloquent)Example News::select('title', 'description')->where('id', 'xxx')->get()->toArray(); Pros
Cons
2. Getting manually using
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, @lamualfa I don't get voyager data__, you mean by that, you need to get the records from the database? Alright, there is a You may take a look here: Or here: |
Beta Was this translation helpful? Give feedback.
Hey, @lamualfa
I don't get voyager data__, you mean by that, you need to get the records from the database?
Alright, there is a
Voyager::model('the model')
if you are looking to fetch the qualified name model, or if you want to set some rules, there are a bunch of methods you can use.You may take a look here:
https://github.com/the-control-group/voyager/blob/1.5/src/Widgets/UserDimmer.php
Or here:
https://voyager-docs.devdojo.com/core-concepts/roles-and-permissions#customize-controller