Skip to content

Commit

Permalink
Update web.stub
Browse files Browse the repository at this point in the history
Create routes from resources and move namespaces importation (`use`) to the top.
  • Loading branch information
solomon-ochepa authored Oct 30, 2023
1 parent f7e539b commit 9243e87
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Commands/stubs/routes/web.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

use Illuminate\Support\Facades\Route;
use $MODULE_NAMESPACE$\$STUDLY_NAME$\$CONTROLLER_NAMESPACE$\$STUDLY_NAME$Controller;

/*
|--------------------------------------------------------------------------
| Web Routes
Expand All @@ -10,9 +13,7 @@
| contains the "web" middleware group. Now create something great!
|
*/
use Illuminate\Support\Facades\Route;
use $MODULE_NAMESPACE$\$STUDLY_NAME$\$CONTROLLER_NAMESPACE$\$STUDLY_NAME$Controller;

Route::prefix('$LOWER_NAME$')->group(function() {
Route::get('/', [$STUDLY_NAME$Controller::class, 'index'])->name('$LOWER_NAME$.index');
Route::group([], function () {
Route::resource('$LOWER_NAME$', $STUDLY_NAME$Controller::class)->names('$LOWER_NAME$');
});

0 comments on commit 9243e87

Please sign in to comment.