@@ -36,4 +36,4 @@ |
||
| 36 | 36 | return $this->subject('New File Uploaded')->markdown('email.newLinkFile'); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | - |
|
| 40 | 39 | \ No newline at end of file |
| 40 | + |
|
| 41 | 41 | \ No newline at end of file |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $fileName = str_replace(' ', '_', $fileName); |
| 33 | 33 | |
| 34 | - if(Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)) |
|
| 34 | + if (Storage::exists($path.DIRECTORY_SEPARATOR.$fileName)) |
|
| 35 | 35 | { |
| 36 | 36 | |
| 37 | 37 | $fileParts = pathinfo($fileName); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | Log::info('File Deleted', ['file_id' => $fileID, 'file_name' => $fileLink, 'user_id' => Auth::user()->user_id]); |
| 74 | 74 | } |
| 75 | - catch(Exception $e) |
|
| 75 | + catch (Exception $e) |
|
| 76 | 76 | { |
| 77 | 77 | return false; |
| 78 | 78 | } |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | // Have a number; increment it |
| 44 | 44 | $base = $match[1]; |
| 45 | 45 | $number = intVal($match[2]); |
| 46 | - } |
|
| 47 | - else |
|
| 46 | + } else |
|
| 48 | 47 | { |
| 49 | 48 | // No number; add one |
| 50 | 49 | $base = $fileParts['filename']; |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | Storage::delete($fileLink); |
| 72 | 71 | |
| 73 | 72 | Log::info('File Deleted', ['file_id' => $fileID, 'file_name' => $fileLink, 'user_id' => Auth::user()->user_id]); |
| 74 | - } |
|
| 75 | - catch(Exception $e) |
|
| 73 | + } catch(Exception $e) |
|
| 76 | 74 | { |
| 77 | 75 | return false; |
| 78 | 76 | } |
@@ -26,10 +26,10 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function register() |
| 28 | 28 | { |
| 29 | - if(Schema::hasTable('settings')) |
|
| 29 | + if (Schema::hasTable('settings')) |
|
| 30 | 30 | { |
| 31 | 31 | $settings = DB::table('settings')->get(); |
| 32 | - foreach($settings as $setting) |
|
| 32 | + foreach ($settings as $setting) |
|
| 33 | 33 | { |
| 34 | 34 | Config([$setting->key => $setting->value]); |
| 35 | 35 | } |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | protected function mapWebRoutes() |
| 53 | 53 | { |
| 54 | 54 | Route::middleware('web') |
| 55 | - ->namespace($this->namespace) |
|
| 56 | - ->group(base_path('routes/web.php')); |
|
| 55 | + ->namespace($this->namespace) |
|
| 56 | + ->group(base_path('routes/web.php')); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | protected function mapApiRoutes() |
| 67 | 67 | { |
| 68 | 68 | Route::prefix('api') |
| 69 | - ->middleware('api') |
|
| 70 | - ->namespace($this->namespace) |
|
| 71 | - ->group(base_path('routes/api.php')); |
|
| 69 | + ->middleware('api') |
|
| 70 | + ->namespace($this->namespace) |
|
| 71 | + ->group(base_path('routes/api.php')); |
|
| 72 | 72 | } |
| 73 | 73 | } |
@@ -16,13 +16,13 @@ |
||
| 16 | 16 | $navBarSys = []; |
| 17 | 17 | $navBarSub = []; |
| 18 | 18 | |
| 19 | - foreach($navItems as $item) |
|
| 19 | + foreach ($navItems as $item) |
|
| 20 | 20 | { |
| 21 | - if(!in_array($item->category, $navBarCat)) |
|
| 21 | + if (!in_array($item->category, $navBarCat)) |
|
| 22 | 22 | { |
| 23 | 23 | $navBarCat[] = $item->category; |
| 24 | 24 | } |
| 25 | - if(empty($item->parent_id)) |
|
| 25 | + if (empty($item->parent_id)) |
|
| 26 | 26 | { |
| 27 | 27 | $navBarSys[$item->sys_id]['category'] = $item->category; |
| 28 | 28 | $navBarSys[$item->sys_id]['name'] = $item->sys_name; |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | $navBarSys[$item->sys_id]['category'] = $item->category; |
| 28 | 28 | $navBarSys[$item->sys_id]['name'] = $item->sys_name; |
| 29 | 29 | $navBarSys[$item->sys_id]['url'] = '/system/'.$item->category.'/'.urlencode($item->sys_name); |
| 30 | - } |
|
| 31 | - else |
|
| 30 | + } else |
|
| 32 | 31 | { |
| 33 | 32 | $navBarSub[$item->sys_id]['category'] = $item->category; |
| 34 | 33 | $navBarSub[$item->sys_id]['parent'] = $item->parent_id; |
@@ -73,11 +73,11 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function hasAnyRole($roles) |
| 75 | 75 | { |
| 76 | - if(is_array($roles)) |
|
| 76 | + if (is_array($roles)) |
|
| 77 | 77 | { |
| 78 | - foreach($roles as $role) |
|
| 78 | + foreach ($roles as $role) |
|
| 79 | 79 | { |
| 80 | - if($this->hasRole($role)) |
|
| 80 | + if ($this->hasRole($role)) |
|
| 81 | 81 | { |
| 82 | 82 | return true; |
| 83 | 83 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | else |
| 87 | 87 | { |
| 88 | - if($this->hasRole($roles)) |
|
| 88 | + if ($this->hasRole($roles)) |
|
| 89 | 89 | { |
| 90 | 90 | return true; |
| 91 | 91 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public function hasRole($role) |
| 98 | 98 | { |
| 99 | - if($this->roles()->where('name', $role)->first()) |
|
| 99 | + if ($this->roles()->where('name', $role)->first()) |
|
| 100 | 100 | { |
| 101 | 101 | return true; |
| 102 | 102 | } |
@@ -82,8 +82,7 @@ |
||
| 82 | 82 | return true; |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | - } |
|
| 86 | - else |
|
| 85 | + } else |
|
| 87 | 86 | { |
| 88 | 87 | if($this->hasRole($roles)) |
| 89 | 88 | { |
@@ -73,13 +73,13 @@ |
||
| 73 | 73 | public function submitPassword(Request $request) |
| 74 | 74 | { |
| 75 | 75 | // Make sure that the old password is valid |
| 76 | - if(!(Hash::check($request->oldPass, Auth::user()->password))) |
|
| 76 | + if (!(Hash::check($request->oldPass, Auth::user()->password))) |
|
| 77 | 77 | { |
| 78 | 78 | return redirect()->back()->with('error', 'Your Current Password is not valid. Please try again.'); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // Make sure that the new password is not the same as the old password |
| 82 | - if(strcmp($request->newPass, $request->oldPass) == 0) |
|
| 82 | + if (strcmp($request->newPass, $request->oldPass) == 0) |
|
| 83 | 83 | { |
| 84 | 84 | return redirect()->back()->with('error', 'New Password cannot be the same as the old password'); |
| 85 | 85 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $fileData = Files::where('file_id', $fileID)->where('file_name', $fileName)->first(); |
| 22 | 22 | // Check that the file exists before allowing it to be downloaded |
| 23 | - if(!empty($fileData) && Storage::exists($fileData->file_link.$fileData->file_name)) |
|
| 23 | + if (!empty($fileData) && Storage::exists($fileData->file_link.$fileData->file_name)) |
|
| 24 | 24 | { |
| 25 | 25 | Log::info('File Downloaded', ['file_id' => $fileID]); |
| 26 | 26 | return Storage::download($fileData->file_link.$fileData->file_name); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | ->with('CustomerSystems.SystemTypes') |
| 53 | 53 | ->whereHas('CustomerSystems', function($q) use($request) |
| 54 | 54 | { |
| 55 | - $q->where('sys_id', $request->system); |
|
| 55 | + $q->where('sys_id', $request->system); |
|
| 56 | 56 | }) |
| 57 | 57 | ->get(); |
| 58 | 58 | } |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | ->get(); |
| 28 | 28 | |
| 29 | 29 | $sysArr = []; |
| 30 | - foreach($systems as $sys) |
|
| 30 | + foreach ($systems as $sys) |
|
| 31 | 31 | { |
| 32 | - foreach($sys->SystemTypes as $s) |
|
| 32 | + foreach ($sys->SystemTypes as $s) |
|
| 33 | 33 | { |
| 34 | 34 | $sysArr[$sys->name][$s->sys_id] = $s->name; |
| 35 | 35 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | public function search(Request $request) |
| 45 | 45 | { |
| 46 | 46 | // Run different request based on if system field is filled out or not |
| 47 | - if(!empty($request->system)) |
|
| 47 | + if (!empty($request->system)) |
|
| 48 | 48 | { |
| 49 | 49 | $customerData = Customers::where('name', 'like', '%'.$request->customer.'%') |
| 50 | 50 | ->where('city', 'like', '%'.$request->city.'%') |
@@ -55,8 +55,7 @@ |
||
| 55 | 55 | $q->where('sys_id', $request->system); |
| 56 | 56 | }) |
| 57 | 57 | ->get(); |
| 58 | - } |
|
| 59 | - else |
|
| 58 | + } else |
|
| 60 | 59 | { |
| 61 | 60 | $customerData = Customers::where('name', 'like', '%'.$request->customer.'%') |
| 62 | 61 | ->where('city', 'like', '%'.$request->city.'%') |