Open drewroberts opened 3 years ago
Looks like its possible by creating defining a relatableLayouts(...)
method in those Nova resources. Reference -
https://nova.laravel.com/docs/3.0/resources/authorization.html#dynamic-relatable-methods
I'll do a quick test.
@drewroberts Adding the following to src/Nova/Page.php
filtered the options.
public static function relatableLayouts(NovaRequest $request, $query)
{
return $query->where('layout_type', LayoutType::PAGE);
}
Should be able to assign this to someone else to create the PR for all of the Nova resources in this package using this technique.
Perfect. Thank you.
@wolfrednicolas Can you knock out this issue today?
Could we limit the Nova Resource relationship to Layout (#60) to just show select options for those Layouts that have the same type as the current Nova Resource? For example, the Page (#15) resource should just show select options for Layouts that have the enum of Page: