summaryrefslogtreecommitdiff
path: root/src/Concerns/CreatesGroups.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Concerns/CreatesGroups.php')
-rw-r--r--src/Concerns/CreatesGroups.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Concerns/CreatesGroups.php b/src/Concerns/CreatesGroups.php
new file mode 100644
index 0000000..e6e4588
--- /dev/null
+++ b/src/Concerns/CreatesGroups.php
@@ -0,0 +1,28 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Lightscale\Router\Concerns;
+
+use Lightscale\Router\Group;
+
+trait CreatesGroups
+{
+ public function prefix(string $value): Group
+ {
+ return new Group(
+ router: $this->getRouter(),
+ parent: $this->getGroup(),
+ prefix: $value,
+ );
+ }
+
+ public function name(string $value): Group
+ {
+ return new Group(
+ router: $this->getRouter(),
+ parent: $this->getGroup(),
+ name: $value,
+ );
+ }
+}