Replies: 1 comment
-
|
Here is a working macro PendingResourceRegistration::macro('group', function($group) {
$name = $this->name;
$shallow = $this->options['shallow'] ?? false;
if ($shallow) {
$name = Str::contains($name, '.') ? Str::afterLast($name, '.') : $name;
}
$as = $name.'.';
$prefix = [];
$names = explode('.', $name);
foreach ($names as $name) {
$prefix[] = $name;
$prefix[] = '{'.Str::singular($name).'}';
}
$prefix = implode('/', $prefix);
Route::prefix($prefix)->as($as)->group($group);
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Now:
What if we improve resource with nested group?
Nested group should inherit prefix and name from parent resource.
Beta Was this translation helpful? Give feedback.
All reactions