@@ -61,6 +61,11 @@ public function testAddAfter(): void
6161
6262 $routes->get('/', 'Home::index');
6363
64+ $routes->group('admin', static function ($routes) {
65+ $routes->get('users', 'Admin\Users::index');
66+ $routes->get('blog', 'Admin\Blog::index');
67+ });
68+
6469 /**
6570 * You will have access to the $routes object within that file without
6671 * needing to reload it.
@@ -69,7 +74,7 @@ public function testAddAfter(): void
6974 FILE;
7075
7176 $ text = 'service( \'auth \')->routes($routes); ' ;
72- $ pattern = '/(.*)(\n ' . preg_quote ('$routes-> ' , '/ ' ) . '[^\n]+?\n)/su ' ;
77+ $ pattern = '/(.*)(\n ' . preg_quote ('$routes-> ' , '/ ' ) . '[^\n]+?; \n)/su ' ;
7378 $ replace = '$1$2 ' . "\n" . $ text . "\n" ;
7479 $ output = $ replacer ->add ($ content , $ text , $ pattern , $ replace );
7580
@@ -88,6 +93,11 @@ public function testAddAfter(): void
8893
8994 service('auth')->routes($routes);
9095
96+ $routes->group('admin', static function ($routes) {
97+ $routes->get('users', 'Admin\Users::index');
98+ $routes->get('blog', 'Admin\Blog::index');
99+ });
100+
91101 /**
92102 * You will have access to the $routes object within that file without
93103 * needing to reload it.
0 commit comments