simplify the routes file a bit

This commit is contained in:
Nabeel Shahzad
2017-12-01 16:15:29 -06:00
parent dbb6e9b4fe
commit 5e2bbe69dc
4 changed files with 28 additions and 20 deletions

View File

@@ -4,6 +4,8 @@ namespace $NAMESPACE$;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;
use Route;
class $CLASS$ extends ServiceProvider
{
@@ -42,7 +44,15 @@ class $CLASS$ extends ServiceProvider
*/
protected function registerRoutes()
{
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
Route::group([
'as' => '$LOWER_NAME$.',
'prefix' => '$LOWER_NAME$',
// If you want a RESTful module, change this to 'api'
'middleware' => ['web'],
'namespace' => '$MODULE_NAMESPACE$\$STUDLY_NAME$\Http\Controllers'
], function() {
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
});
}
/**