@@ -25,11 +25,11 @@ class {class} extends ServiceProvider
25
25
public function register()
26
26
{
27
27
28
- // $this->registerViews();
29
- //$this->registerRoot();
30
- //$this->registerAdminRoot();
31
- //$this->registerMiddleware();
32
-
28
+ // $this->registerViews();
29
+ //$this->registerRoot();
30
+ //$this->registerAdminRoot();
31
+ //$this->registerMiddleware();
32
+ //$this->registerApiRoutes();
33
33
}
34
34
35
35
public function registerRoot()
@@ -39,8 +39,8 @@ class {class} extends ServiceProvider
39
39
->namespace('cms\{module}\Controllers')
40
40
->group(__DIR__ . '/../routes.php');
41
41
42
-
43
42
}
43
+
44
44
public function registerAdminRoot()
45
45
{
46
46
@@ -49,7 +49,6 @@ class {class} extends ServiceProvider
49
49
->namespace('cms\{module}\Controllers')
50
50
->group(__DIR__ . '/../adminroutes.php');
51
51
52
-
53
52
}
54
53
55
54
/**
@@ -82,4 +81,15 @@ class {class} extends ServiceProvider
82
81
app('router')->aliasMiddleware('MiddleWareName', middlewarepath::class);
83
82
}
84
83
84
+ /*
85
+ * register api routes
86
+ */
87
+ public function registerApiRoutes() {
88
+
89
+ Route::prefix('api')
90
+ ->middleware(['UserAuthForApi'])
91
+ ->namespace('cms\{module}\Controllers')
92
+ ->group(__DIR__ . '/../apiroutes.php');
93
+ }
94
+
85
95
}
0 commit comments