Open EngBadr opened 3 years ago
I don't like the idea of supporting arbitrary scope argument names in the json. That sounds like a maintenance nightmare, not to mention making our scope-handling code now have to dynamically inject an arbitrary number of arguments.
Instead, I think it would be better to handle it much more like how laravel does. So the syntax would be something like:
{
"scope": "type:1"
}
Having said that, we (internally) have effectively frozen features on Voyager 1 and are focusing development on Voyager 2. Though if someone else wants to put in the effort to add support for this, we'll gladly review/merge/release it.
Any update on this feature request?
Version information
Description of problem
Voyager relationship details seems to perfectly support the static scope concept.
In the following scheme I have a table that hold types of objects such as (gender:M,F , institute level : "KG, Primary,",course for each level ).
In My model I follow the documentation by creating something like
in Voyager relationship details I post the JSON
This working fine. However above table will used in many relations and models such as course types , class in each institute ,... etc So, the goal is to generalize scope without hardcoding each type. I think I should use the dynamic scope concept for any type. I need to pass another parameter such as
Where gid is the required id in relationship details. Thus, for institute level I should pass "gid":1
institute of primary school level the course should displayed only "gid":4 .
I think , this should done through using dynamic scope. Is this possible using current Voyager and Laravel versions.
Proposed solution
For now I think I should override the current controller to handle this feature. I 'am not sure about the solution but I will try it. If any better solution will be appreciated.