@@ -25,7 +25,8 @@ discard block |
||
25 | 25 | // Validate the hash token |
26 | 26 | $user = UserInitialize::where('token', $hash)->get(); |
27 | 27 | |
28 | - if($user->isEmpty()) { |
|
28 | + if($user->isEmpty()) |
|
29 | + { |
|
29 | 30 | Log::warning('Visitor at IP Address '.\Request::ip().' tried to access invalid initialize hash - '.$hash); |
30 | 31 | return abort(404); |
31 | 32 | } |
@@ -43,7 +44,8 @@ discard block |
||
43 | 44 | |
44 | 45 | // Verify that the link matches the assigned email address |
45 | 46 | $valid = UserInitialize::where('token', $hash)->first(); |
46 | - if(empty($valid)) { |
|
47 | + if(empty($valid)) |
|
48 | + { |
|
47 | 49 | Log::warning('Visitor at IP Address '.\Request::ip().' tried to submit an invalid User Initialization link - '.$hash); |
48 | 50 | return abort(404); |
49 | 51 | } |
@@ -41,7 +41,8 @@ discard block |
||
41 | 41 | ]; |
42 | 42 | } |
43 | 43 | $mods = Module::allDisabled(); |
44 | - foreach($mods as $name => $mod) { |
|
44 | + foreach($mods as $name => $mod) |
|
45 | + { |
|
45 | 46 | $moduleList[] = [ |
46 | 47 | 'name' => $name, |
47 | 48 | 'status' => 'Disabled', |
@@ -78,7 +79,8 @@ discard block |
||
78 | 79 | $receiver = new FileReceiver('file', $request, HandlerFactory::classFromRequest($request)); |
79 | 80 | |
80 | 81 | // Verify that the upload is valid and being processed |
81 | - if($receiver->isUploaded() === false) { |
|
82 | + if($receiver->isUploaded() === false) |
|
83 | + { |
|
82 | 84 | Log::error('Upload File Missing - '. |
83 | 85 | /** @scrutinizer ignore-type */ |
84 | 86 | $request->toArray()); |
@@ -89,7 +91,8 @@ discard block |
||
89 | 91 | $save = $receiver->receive(); |
90 | 92 | |
91 | 93 | // See if the uploade has finished |
92 | - if($save->isFinished()) { |
|
94 | + if($save->isFinished()) |
|
95 | + { |
|
93 | 96 | $this->saveFile($save->getFile()); |
94 | 97 | |
95 | 98 | return 'uploaded successfully'; |
@@ -211,7 +211,8 @@ |
||
211 | 211 | public function destroy($id) |
212 | 212 | { |
213 | 213 | // |
214 | - try { |
|
214 | + try |
|
215 | + { |
|
215 | 216 | SystemTypes::find($id)->delete(); |
216 | 217 | return response()->json(['success' => true, 'reason' => 'Equipment Successfully Deleted']); |
217 | 218 | } |
@@ -103,10 +103,13 @@ |
||
103 | 103 | { |
104 | 104 | Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
105 | 105 | |
106 | - try { |
|
106 | + try |
|
107 | + { |
|
107 | 108 | // Try to delete file type from database - will throw error if foreign key is in use |
108 | 109 | CustomerFileTypes::find($id)->delete(); |
109 | - } catch (\Illuminate\Database\QueryException $e) { |
|
110 | + } |
|
111 | + catch (\Illuminate\Database\QueryException $e) |
|
112 | + { |
|
110 | 113 | // Unable to remove file type from the database |
111 | 114 | Log::warning('Attempt to delete file type ID '.$id.' by User '.Auth::user()->full_name.' failed. Reason - ' . $e); |
112 | 115 | return response()->json(['success' => false, 'reason' => 'In Use']); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function getUserCustomerFavs() |
25 | 25 | { |
26 | 26 | $custFavs = CustomerFavs::where('user_id', $this->userID) |
27 | - ->with(array('Customers' => function($query){ |
|
27 | + ->with(array('Customers' => function($query) { |
|
28 | 28 | $query->select('cust_id', 'name'); |
29 | 29 | })) |
30 | 30 | ->get(); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function getUserTechTipFavs() |
36 | 36 | { |
37 | 37 | $tipFavs = TechTipFavs::where('user_id', $this->userID) |
38 | - ->with(array('TechTips' => function($query){ |
|
38 | + ->with(array('TechTips' => function($query) { |
|
39 | 39 | $query->select('tip_id', 'subject'); |
40 | 40 | })) |
41 | 41 | ->get(); |
@@ -26,7 +26,8 @@ |
||
26 | 26 | ->orderBy('expire', 'desc')->get(); |
27 | 27 | |
28 | 28 | Log::debug('Retrieved all File Links for User ID '.$this->id.'. Data Gathered - ', array($links)); |
29 | - if ($this->collection) { |
|
29 | + if ($this->collection) |
|
30 | + { |
|
30 | 31 | return new FileLinksCollection($links); |
31 | 32 | } |
32 | 33 |
@@ -108,7 +108,8 @@ |
||
108 | 108 | { |
109 | 109 | $data = Files::find($fileID); |
110 | 110 | // Move the file to the proper folder |
111 | - try{ |
|
111 | + try |
|
112 | + { |
|
112 | 113 | Log::debug('Attempting to moving file '.$fileID.' to '.$newPath); |
113 | 114 | Storage::move($data->file_link.$data->file_name, $newPath.DIRECTORY_SEPARATOR.$data->file_name); |
114 | 115 | } |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | $searchResults = new CustomersCollection( |
48 | 48 | Customers::orderBy($request->sortField, $request->sortType) |
49 | 49 | // Search the name, dba name, and cust id columns |
50 | - ->where(function($query) use ($request) |
|
51 | - { |
|
50 | + ->where(function($query) use ($request) { |
|
52 | 51 | $query->where('name', 'like', '%'.$request->name.'%') |
53 | 52 | ->orWhere('cust_id', 'like', '%'.$request->name.'%') |
54 | 53 | ->orWhere('dba_name', 'like', '%'.$request->name.'%'); |
@@ -58,10 +57,8 @@ discard block |
||
58 | 57 | // Include the customers systems |
59 | 58 | ->with('CustomerSystems.SystemTypes') |
60 | 59 | // If the system field is present - search for system type |
61 | - ->when($request->system, function($query) use ($request) |
|
62 | - { |
|
63 | - $query->whereHas('CustomerSystems.SystemTypes', function($query) use ($request) |
|
64 | - { |
|
60 | + ->when($request->system, function($query) use ($request) { |
|
61 | + $query->whereHas('CustomerSystems.SystemTypes', function($query) use ($request) { |
|
65 | 62 | $query->where('sys_id', $request->system); |
66 | 63 | }); |
67 | 64 | }) |
@@ -143,8 +143,7 @@ |
||
143 | 143 | { |
144 | 144 | if(isset($equip['laravel_through_key'])) |
145 | 145 | { |
146 | - $current = $current->filter(function($item) use ($equip) |
|
147 | - { |
|
146 | + $current = $current->filter(function($item) use ($equip) { |
|
148 | 147 | return $item->sys_id != $equip['sys_id']; |
149 | 148 | }); |
150 | 149 | } |