Skip to content

Commit

Permalink
Merge pull request #1925 from solomon-ochepa/patch-56
Browse files Browse the repository at this point in the history
Update route-provider.stub
  • Loading branch information
dcblogdev authored Sep 10, 2024
2 parents 7a2a65e + f5b4845 commit 2024e85
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 36 deletions.
7 changes: 4 additions & 3 deletions src/Commands/stubs/route-provider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class $CLASS$ extends ServiceProvider
{
protected string $name = '$MODULE$';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class $CLASS$ extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class $CLASS$ extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('$MODULE$', '$WEB_ROUTES_PATH$'));
Route::middleware('web')->group(module_path($this->name, '$WEB_ROUTES_PATH$'));
}

/**
Expand All @@ -44,6 +45,6 @@ class $CLASS$ extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('$MODULE$', '$API_ROUTES_PATH$'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '$API_ROUTES_PATH$'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/routes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/routes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/routes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/routes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/routes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/routes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/routes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/routes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/routes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/routes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/routes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/routes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/routes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/routes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/routes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/routes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/SuperRoutes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/SuperRoutes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/routes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi

class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Blog';

/**
* Called before routes are registered.
*
Expand All @@ -23,7 +25,6 @@ class RouteServiceProvider extends ServiceProvider
public function map(): void
{
$this->mapApiRoutes();

$this->mapWebRoutes();
}

Expand All @@ -34,7 +35,7 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Blog', '/SuperRoutes/web.php'));
Route::middleware('web')->group(module_path($this->name, '/SuperRoutes/web.php'));
}

/**
Expand All @@ -44,6 +45,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Blog', '/SuperRoutes/api.php'));
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/SuperRoutes/api.php'));
}
}
Loading

0 comments on commit 2024e85

Please sign in to comment.