Skip to content

Commit 4642010

Browse files
committed
new auth route register fixed
1 parent 1e78e92 commit 4642010

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/Console/Commands/MakeMultiAuthCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ protected function registerRoutes()
180180
return;
181181
}
182182

183-
preg_match('/\s+\/\*\*\n\s+\*\s(\w+\s)+"web"\s(\w+\s)+\w+.\n/', $provider, $match);
184-
$provider = str_replace($match[0], $map . $match[0], $provider);
183+
$toReplace = '$this->routes(function () {';
184+
$provider = str_replace($toReplace, $toReplace . $map, $provider);
185185
/********** Function Call **********/
186186

187187
$map_call = file_get_contents($this->stub_path . '/routes/map_call.stub');

stubs/routes/map.stub

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
2-
3-
/**
4-
* Define the "{{singularSnake}}" routes for the application.
5-
*
6-
* These routes are typically stateless.
7-
*
8-
* @return void
9-
*/
10-
protected function map{{singularClass}}Routes()
11-
{
12-
Route::prefix('{{singularSlug}}')
13-
->middleware(['web'])
14-
->namespace($this->namespace)
15-
->group(base_path('routes/{{singularSlug}}.php'));
16-
}
171

2+
Route::prefix('{{singularSlug}}')
3+
->middleware(['web'])
4+
->namespace($this->namespace)
5+
->group(base_path('routes/{{singularSlug}}.php'));

0 commit comments

Comments
 (0)