@@ -18,8 +18,8 @@ |
||
18 | 18 | public function handle($request, Closure $next) |
19 | 19 | { |
20 | 20 | |
21 | - if($request->session()->has('language')){ |
|
22 | - $local = $request->session()->get('language',config('app.locale')); |
|
21 | + if ($request->session()->has('language')) { |
|
22 | + $local = $request->session()->get('language', config('app.locale')); |
|
23 | 23 | app()->setLocale($local); |
24 | 24 | } |
25 | 25 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | }); |
31 | 31 | |
32 | -$router->group(array('middleware' => ['auth','language']), function() use($router) |
|
32 | +$router->group(array('middleware' => ['auth', 'language']), function() use($router) |
|
33 | 33 | { |
34 | 34 | $router->group(array('middleware' => 'permission', 'prefix' => config('expendable.admin_base_uri')), function() use($router) |
35 | 35 | { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $id_element = $this->model->hasBeenTranslated($this->model->getTable(), $id, $iso); |
79 | 79 | if (!empty($id_element)) { |
80 | - return redirect()->to(action($this->getControllerNameForAction() . '@getEdit', $id_element)); |
|
80 | + return redirect()->to(action($this->getControllerNameForAction().'@getEdit', $id_element)); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $model = (!empty($id) || $id === "0") ? $this->model->withoutTranslation()->findOrFail($id) : $this->model; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | return $result; |
134 | 134 | } |
135 | 135 | |
136 | - return redirect()->to(action($this->getControllerNameForAction() . '@getIndex')); |
|
136 | + return redirect()->to(action($this->getControllerNameForAction().'@getIndex')); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | // ------------------------------------------------------------------------------------------------ |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | return $result; |
168 | 168 | } |
169 | 169 | |
170 | - return redirect()->to(action($this->getControllerNameForAction() . '@getIndex')); |
|
170 | + return redirect()->to(action($this->getControllerNameForAction().'@getIndex')); |
|
171 | 171 | |
172 | 172 | } |
173 | 173 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $form_content = view('form-builder::form.components.formgenerator.info', [ |
231 | 231 | 'form' => $form, |
232 | 232 | 'id' => $id, |
233 | - 'route' => $this->getControllerNameForAction() . '@', |
|
233 | + 'route' => $this->getControllerNameForAction().'@', |
|
234 | 234 | ]); |
235 | 235 | |
236 | 236 | $this->layoutManager->add([ |
@@ -250,6 +250,6 @@ discard block |
||
250 | 250 | |
251 | 251 | $action = explode('@', \Route::currentRouteAction()); |
252 | 252 | |
253 | - return '\\' . $action[0]; |
|
253 | + return '\\'.$action[0]; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | \ No newline at end of file |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | protected function registerRouter() |
15 | 15 | { |
16 | - $this->app->singleton('router',function ($app) { |
|
16 | + $this->app->singleton('router', function($app) { |
|
17 | 17 | return new Router($app['events'], $app); |
18 | 18 | }); |
19 | 19 | } |
@@ -96,6 +96,10 @@ |
||
96 | 96 | ]; |
97 | 97 | } |
98 | 98 | |
99 | + /** |
|
100 | + * @param string $key |
|
101 | + * @param null|integer $default_value |
|
102 | + */ |
|
99 | 103 | protected function getParams(Request $request, $key, $default_value) |
100 | 104 | { |
101 | 105 | $element = $request->get($key); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $data = $this->model->where($this->model->getKeyName(), $request->get('id'))->get()->last(); |
39 | 39 | $data->delete(); |
40 | 40 | |
41 | - return redirect()->to(action('\\' . get_class($this) . '@getIndex')); |
|
41 | + return redirect()->to(action('\\'.get_class($this).'@getIndex')); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | // ------------------------------------------------------------------------------------------------ |
@@ -41,8 +41,8 @@ |
||
41 | 41 | |
42 | 42 | protected function getUpdateRules() |
43 | 43 | { |
44 | - $key = \Request::get($this->model->getKeyName()); |
|
45 | - static::$rules_update['initials'] = 'required|unique:roles,initials' . $key; |
|
44 | + $key = \Request::get($this->model->getKeyName()); |
|
45 | + static::$rules_update['initials'] = 'required|unique:roles,initials'.$key; |
|
46 | 46 | |
47 | 47 | return parent::getUpdateRules(); |
48 | 48 | } |
@@ -77,7 +77,7 @@ |
||
77 | 77 | protected function getUpdateRules() |
78 | 78 | { |
79 | 79 | $key = \Request::get($this->model->getKeyName()); |
80 | - static::$rules_update['email'] = 'required|email|unique:users,email,' . $key; |
|
80 | + static::$rules_update['email'] = 'required|email|unique:users,email,'.$key; |
|
81 | 81 | |
82 | 82 | return parent::getUpdateRules(); |
83 | 83 | } |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | { |
47 | 47 | $allModels = [ |
48 | 48 | [ |
49 | - 'path' => app_path() . DIRECTORY_SEPARATOR, |
|
49 | + 'path' => app_path().DIRECTORY_SEPARATOR, |
|
50 | 50 | 'namespace' => '{{app}}', |
51 | 51 | ], |
52 | 52 | [ |
53 | - 'path' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Models' . DIRECTORY_SEPARATOR, |
|
53 | + 'path' => __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Models'.DIRECTORY_SEPARATOR, |
|
54 | 54 | 'namespace' => 'Distilleries\\Expendable\\Models\\', |
55 | 55 | ], |
56 | 56 | ]; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | $choice = explode('/', $model); |
65 | 65 | $model = preg_replace('/.php/i', '', last($choice)); |
66 | - $choices[$config['namespace'] . $model] = $model; |
|
66 | + $choices[$config['namespace'].$model] = $model; |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | protected function getUpdateRules() |
45 | 45 | { |
46 | 46 | $key = \Request::get($this->model->getKeyName()); |
47 | - static::$rules['iso'] = 'required|unique:languages,iso,' . $key; |
|
47 | + static::$rules['iso'] = 'required|unique:languages,iso,'.$key; |
|
48 | 48 | |
49 | 49 | return parent::getUpdateRules(); |
50 | 50 | } |