Skip to content

Commit

Permalink
new auth route register fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthaksavvy committed Nov 17, 2020
1 parent 1e78e92 commit 4642010
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/Console/Commands/MakeMultiAuthCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ protected function registerRoutes()
return;
}

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

$map_call = file_get_contents($this->stub_path . '/routes/map_call.stub');
Expand Down
20 changes: 4 additions & 16 deletions stubs/routes/map.stub
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@


/**
* Define the "{{singularSnake}}" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function map{{singularClass}}Routes()
{
Route::prefix('{{singularSlug}}')
->middleware(['web'])
->namespace($this->namespace)
->group(base_path('routes/{{singularSlug}}.php'));
}

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

0 comments on commit 4642010

Please sign in to comment.