@@ -47,15 +47,15 @@ discard block |
||
47 | 47 | { |
48 | 48 | $allModels = [ |
49 | 49 | [ |
50 | - 'path' => app_path() . DIRECTORY_SEPARATOR, |
|
50 | + 'path' => app_path().DIRECTORY_SEPARATOR, |
|
51 | 51 | 'namespace' => '{{app}}', |
52 | 52 | ], |
53 | 53 | [ |
54 | - 'path' => app_path() . DIRECTORY_SEPARATOR . 'Models' . DIRECTORY_SEPARATOR, |
|
54 | + 'path' => app_path().DIRECTORY_SEPARATOR.'Models'.DIRECTORY_SEPARATOR, |
|
55 | 55 | 'namespace' => '{{app}}Models\\', |
56 | 56 | ], |
57 | 57 | [ |
58 | - 'path' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'Models' . DIRECTORY_SEPARATOR, |
|
58 | + 'path' => __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'Models'.DIRECTORY_SEPARATOR, |
|
59 | 59 | 'namespace' => 'Distilleries\\Expendable\\Models\\', |
60 | 60 | ], |
61 | 61 | ]; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | foreach ($models as $model) { |
68 | 68 | $choice = explode('/', $model); |
69 | 69 | $model = preg_replace('/.php/i', '', last($choice)); |
70 | - $choices[$config['namespace'] . $model] = $model; |
|
70 | + $choices[$config['namespace'].$model] = $model; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 |
@@ -16,13 +16,13 @@ |
||
16 | 16 | */ |
17 | 17 | public function handle($request, Closure $next, $guard = null, $field = null) |
18 | 18 | { |
19 | - $ipsAuth = env('BASIC_AUTH_IP',''); |
|
20 | - $ipsAuth = explode(',',$ipsAuth); |
|
19 | + $ipsAuth = env('BASIC_AUTH_IP', ''); |
|
20 | + $ipsAuth = explode(',', $ipsAuth); |
|
21 | 21 | |
22 | 22 | |
23 | - if (env('BASIC_AUTH',false) == true) |
|
23 | + if (env('BASIC_AUTH', false) == true) |
|
24 | 24 | { |
25 | - if(empty($ipsAuth) || !in_array($request->ip(),$ipsAuth)) |
|
25 | + if (empty($ipsAuth) || !in_array($request->ip(), $ipsAuth)) |
|
26 | 26 | { |
27 | 27 | return $this->auth->guard($guard)->basic() ?: $next($request); |
28 | 28 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | $translation = new Translation; |
45 | 45 | |
46 | - return $translation->getTable() . '.' . $translation->getIsoColumn(); |
|
46 | + return $translation->getTable().'.'.$translation->getIsoColumn(); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $translation = new Translation; |
57 | 57 | |
58 | - return $translation->getTable() . '.' . $translation->getIdElementColumn(); |
|
58 | + return $translation->getTable().'.'.$translation->getIdElementColumn(); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $translation = new Translation; |
69 | 69 | |
70 | - return $translation->getTable() . '.' . $translation->getModelColumn(); |
|
70 | + return $translation->getTable().'.'.$translation->getModelColumn(); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | { |
80 | 80 | $translation = new Translation; |
81 | 81 | |
82 | - return $translation->getTable() . '.' . $translation->getIdSourceColumn(); |
|
82 | + return $translation->getTable().'.'.$translation->getIdSourceColumn(); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | ->where($this->getQualifiedIsoColumn(), '=', $iso)->get(); |
103 | 103 | |
104 | 104 | if (!$translation->isEmpty()) { |
105 | - $translation->each(function($trans){ |
|
105 | + $translation->each(function($trans) { |
|
106 | 106 | $trans->delete(); |
107 | 107 | }); |
108 | 108 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | public function model(array $row) |
32 | 32 | { |
33 | 33 | $data = []; |
34 | - foreach($this->model->getFillable() as $value) |
|
34 | + foreach ($this->model->getFillable() as $value) |
|
35 | 35 | { |
36 | 36 | $data[$value] = $row[$value]; |
37 | 37 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $dateStart = !empty($data['range']) && !empty($data['range']['start']) ? $data['range']['start'] : Carbon::now()->format('Y-m-d'); |
54 | 54 | $dateEnd = !empty($data['range']) && !empty($data['range']['end']) ? $data['range']['end'] : Carbon::now()->format('Y-m-d'); |
55 | 55 | $type = !empty($data['type']) ? $data['type'] : 'csv'; |
56 | - $filename = str_replace('/', '-', $dateStart . '_' . $dateEnd) . '.' . mb_strtolower($type); |
|
56 | + $filename = str_replace('/', '-', $dateStart.'_'.$dateEnd).'.'.mb_strtolower($type); |
|
57 | 57 | |
58 | 58 | return (new BaseExport($this->model, $data))->export($filename); |
59 | 59 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $menu = $this->config->get('expendable.menu'); |
46 | 46 | $user = $this->auth->user(); |
47 | 47 | |
48 | - if (method_exists($user, 'getFirstRedirect') && !empty($menu) && !empty($menu['left'])) |
|
48 | + if (method_exists($user, 'getFirstRedirect') && !empty($menu) && !empty($menu['left'])) |
|
49 | 49 | { |
50 | 50 | return new RedirectResponse($this->auth->user()->getFirstRedirect($menu['left'])); |
51 | 51 | } |
@@ -11,7 +11,9 @@ discard block |
||
11 | 11 | { |
12 | 12 | $user = Auth::user(); |
13 | 13 | |
14 | - if (empty($user)) return false; |
|
14 | + if (empty($user)) { |
|
15 | + return false; |
|
16 | + } |
|
15 | 17 | |
16 | 18 | return !empty(Auth::user()->role) && (Auth::user()->role->initials == '@sa' || Auth::user()->role->initials == '@a'); |
17 | 19 | } |
@@ -27,7 +29,9 @@ discard block |
||
27 | 29 | { |
28 | 30 | $user = Auth::user(); |
29 | 31 | |
30 | - if (empty($user)) return false; |
|
32 | + if (empty($user)) { |
|
33 | + return false; |
|
34 | + } |
|
31 | 35 | |
32 | 36 | return !empty(Auth::user()->role) && in_array(Auth::user()->role->initials, self::frontendInitialRole()); |
33 | 37 | } |