Skip to content

Commit

Permalink
chore: stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
jevantang committed Mar 26, 2024
1 parent c9ada39 commit e62a22d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Commands/stubs/app/Providers/route-provider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ class RouteServiceProvider extends BaseServiceProvider
*/
protected function mapApiRoutes(): void
{
Route::prefix('api')->middleware('api')->group(dirname(__DIR__, 2) . '/routes/api.php');
Route::prefix('api')->name('api.')->middleware('api')->group(dirname(__DIR__, 2) . '/routes/api.php');
}
}
10 changes: 5 additions & 5 deletions src/Commands/stubs/routes/api.stub
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ use $PLUGIN_NAMESPACE$\$STUDLY_NAME$\Http\Controllers as ApiController;
|
*/

// Route::middleware('auth:api')->get('$KEBAB_NAME$', function (Request $request) {
// return $request->user();
// });
// Route::prefix('$KEBAB_NAME$')->name('$KEBAB_NAME$.')->group([], function() {
// Route::get('/', [ApiController\$STUDLY_NAME$SettingController::class, 'index'])->name('index');

// Route::group([], function() {
// Route::get('$KEBAB_NAME$', [ApiController\$STUDLY_NAME$SettingController::class, 'index']);
// Route::middleware('auth:api')->get('auth', function (Request $request) {
// return $request->user();
// })->name('auth');
// });
24 changes: 12 additions & 12 deletions src/Commands/stubs/routes/web.stub
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ use $PLUGIN_NAMESPACE$\$STUDLY_NAME$\Http\Controllers as WebController;
|
*/

Route::group([], function() {
Route::get('$KEBAB_NAME$', [WebController\$STUDLY_NAME$SettingController::class, 'index'])->name('$KEBAB_NAME$.index');
Route::get('$KEBAB_NAME$/setting', [WebController\$STUDLY_NAME$SettingController::class, 'showSettingView'])->name('$KEBAB_NAME$.setting');
Route::post('$KEBAB_NAME$/setting', [WebController\$STUDLY_NAME$SettingController::class, 'saveSetting']);
});
Route::prefix('$KEBAB_NAME$')->name('$KEBAB_NAME$.')->group([], function() {
Route::get('/', [WebController\$STUDLY_NAME$SettingController::class, 'index'])->name('index');
Route::get('settings', [WebController\$STUDLY_NAME$SettingController::class, 'showSettingView'])->name('setting');
Route::post('setting', [WebController\$STUDLY_NAME$SettingController::class, 'saveSetting'])->name('save.setting');

// without VerifyCsrfToken
// Route::withoutMiddleware([
// \App\Http\Middleware\EncryptCookies::class,
// \App\Http\Middleware\VerifyCsrfToken::class,
// ])->group(function() {
// Route::get('$KEBAB_NAME$', [WebController\$STUDLY_NAME$SettingController::class, 'index']);
// });
// without VerifyCsrfToken
// Route::withoutMiddleware([
// \App\Http\Middleware\EncryptCookies::class,
// \App\Http\Middleware\VerifyCsrfToken::class,
// ])->group(function() {
// Route::get('example', [WebController\$STUDLY_NAME$SettingController::class, 'index'])->name('example');
// });
});

0 comments on commit e62a22d

Please sign in to comment.