@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | private function mapHostRoutes($router, $groupOptions, $middlewares, $supportSubdomainRouting) |
69 | 69 | { |
70 | 70 | if (file_exists(base_path('routes/admin.php'))) { |
71 | - $hostRoutes = function ($router) use ($middlewares) { |
|
71 | + $hostRoutes = function($router) use ($middlewares) { |
|
72 | 72 | $router->group([ |
73 | 73 | 'namespace' => config('twill.namespace', 'App') . '\Http\Controllers\Admin', |
74 | 74 | 'middleware' => $middlewares, |
75 | - ], function ($router) { |
|
75 | + ], function($router) { |
|
76 | 76 | require base_path('routes/admin.php'); |
77 | 77 | }); |
78 | 78 | }; |
@@ -91,25 +91,25 @@ discard block |
||
91 | 91 | |
92 | 92 | private function mapInternalRoutes($router, $groupOptions, $middlewares, $supportSubdomainRouting) |
93 | 93 | { |
94 | - $internalRoutes = function ($router) use ($middlewares, $supportSubdomainRouting) { |
|
95 | - $router->group(['middleware' => $middlewares], function ($router) { |
|
94 | + $internalRoutes = function($router) use ($middlewares, $supportSubdomainRouting) { |
|
95 | + $router->group(['middleware' => $middlewares], function($router) { |
|
96 | 96 | require __DIR__ . '/../routes/admin.php'; |
97 | 97 | }); |
98 | 98 | |
99 | 99 | $router->group([ |
100 | 100 | 'middleware' => $supportSubdomainRouting ? ['supportSubdomainRouting'] : [], |
101 | - ], function ($router) { |
|
101 | + ], function($router) { |
|
102 | 102 | require __DIR__ . '/../routes/auth.php'; |
103 | 103 | }); |
104 | 104 | |
105 | - $router->group(['middleware' => $this->app->environment('production') ? ['twill_auth:twill_users'] : []], function ($router) { |
|
105 | + $router->group(['middleware' => $this->app->environment('production') ? ['twill_auth:twill_users'] : []], function($router) { |
|
106 | 106 | require __DIR__ . '/../routes/templates.php'; |
107 | 107 | }); |
108 | 108 | }; |
109 | 109 | |
110 | 110 | $router->group($groupOptions + [ |
111 | 111 | 'namespace' => $this->namespace . '\Admin', |
112 | - ], function ($router) use ($internalRoutes, $supportSubdomainRouting) { |
|
112 | + ], function($router) use ($internalRoutes, $supportSubdomainRouting) { |
|
113 | 113 | $router->group([ |
114 | 114 | 'domain' => config('twill.admin_app_url'), |
115 | 115 | ], $internalRoutes); |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | 'domain' => config('app.url'), |
128 | 128 | 'middleware' => [config('twill.admin_middleware_group', 'web')], |
129 | 129 | ], |
130 | - function ($router) { |
|
131 | - $router->group(['middleware' => $this->app->environment('production') ? ['twill_auth:twill_users'] : []], function ($router) { |
|
130 | + function($router) { |
|
131 | + $router->group(['middleware' => $this->app->environment('production') ? ['twill_auth:twill_users'] : []], function($router) { |
|
132 | 132 | require __DIR__ . '/../routes/templates.php'; |
133 | 133 | }); |
134 | 134 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | protected function registerMacros() |
164 | 164 | { |
165 | - Route::macro('moduleShowWithPreview', function ($moduleName, $routePrefix = null, $controllerName = null) { |
|
165 | + Route::macro('moduleShowWithPreview', function($moduleName, $routePrefix = null, $controllerName = null) { |
|
166 | 166 | if ($routePrefix === null) { |
167 | 167 | $routePrefix = $moduleName; |
168 | 168 | } |
@@ -178,12 +178,12 @@ discard block |
||
178 | 178 | Route::name($moduleName . '.preview')->get('/admin-preview' . $routePrefix . '{slug}', $controllerName . 'Controller@show')->middleware(['web', 'twill_auth:twill_users', 'can:list']); |
179 | 179 | }); |
180 | 180 | |
181 | - Route::macro('module', function ($slug, $options = [], $resource_options = [], $resource = true) { |
|
181 | + Route::macro('module', function($slug, $options = [], $resource_options = [], $resource = true) { |
|
182 | 182 | |
183 | 183 | $slugs = explode('.', $slug); |
184 | 184 | $prefixSlug = str_replace('.', "/", $slug); |
185 | 185 | $_slug = Arr::last($slugs); |
186 | - $className = implode("", array_map(function ($s) { |
|
186 | + $className = implode("", array_map(function($s) { |
|
187 | 187 | return ucfirst(Str::singular($s)); |
188 | 188 | }, $slugs)); |
189 | 189 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | if ($resource) { |
232 | 232 | $customRoutePrefix = !empty($groupPrefix) ? "{$groupPrefix}." : ""; |
233 | - Route::group(['as' => $customRoutePrefix], function () use ($slug, $className, $resource_options) { |
|
233 | + Route::group(['as' => $customRoutePrefix], function() use ($slug, $className, $resource_options) { |
|
234 | 234 | Route::resource($slug, "{$className}Controller", $resource_options); |
235 | 235 | }); |
236 | 236 | } |