@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
119 | 119 | |
120 | 120 | // check if the upload is success, throw exception or return response you need |
121 | - if ($receiver->isUploaded() === false) { |
|
121 | + if($receiver->isUploaded() === false) { |
|
122 | 122 | throw new UploadMissingFileException(); |
123 | 123 | } |
124 | 124 | |
125 | 125 | // receive the file |
126 | 126 | $save = $receiver->receive(); |
127 | 127 | |
128 | - if ($save->isFinished()) |
|
128 | + if($save->isFinished()) |
|
129 | 129 | { |
130 | 130 | $tipID = $this->createNewTechTip($request); |
131 | 131 | $filePath = config('filesystems.paths.tips').DIRECTORY_SEPARATOR.$tipID; |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | // Toggle whether or not the customer is listed as a user favorite |
346 | 346 | public function toggleFav($action, $tipID) |
347 | 347 | { |
348 | - switch ($action) |
|
348 | + switch($action) |
|
349 | 349 | { |
350 | 350 | case 'add': |
351 | 351 | TechTipFavs::create([ |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | if(!empty($request->system)) |
64 | 64 | { |
65 | 65 | $tipData = TechTips::where('subject', 'like', '%'.$request->tipSearch.'%') |
66 | - ->whereHas('TechTipSystems', function($q) use($request) |
|
67 | - { |
|
66 | + ->whereHas('TechTipSystems', function($q) use($request) { |
|
68 | 67 | $q->where('sys_id', $request->system); |
69 | 68 | }) |
70 | 69 | ->get(); |
@@ -118,14 +117,15 @@ discard block |
||
118 | 117 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
119 | 118 | |
120 | 119 | // check if the upload is success, throw exception or return response you need |
121 | - if ($receiver->isUploaded() === false) { |
|
120 | + if ($receiver->isUploaded() === false) |
|
121 | + { |
|
122 | 122 | throw new UploadMissingFileException(); |
123 | 123 | } |
124 | 124 | |
125 | 125 | // receive the file |
126 | 126 | $save = $receiver->receive(); |
127 | 127 | |
128 | - if ($save->isFinished()) |
|
128 | + if ($save->isFinished()) |
|
129 | 129 | { |
130 | 130 | $tipID = $this->createNewTechTip($request); |
131 | 131 | $filePath = config('filesystems.paths.tips').DIRECTORY_SEPARATOR.$tipID; |
@@ -49,19 +49,19 @@ discard block |
||
49 | 49 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
50 | 50 | |
51 | 51 | // check if the upload is success, throw exception or return response you need |
52 | - if ($receiver->isUploaded() === false) { |
|
52 | + if($receiver->isUploaded() === false) { |
|
53 | 53 | throw new UploadMissingFileException(); |
54 | 54 | } |
55 | 55 | |
56 | 56 | // receive the file |
57 | 57 | $save = $receiver->receive(); |
58 | 58 | // check if the upload has finished (in chunk mode it will send smaller files) |
59 | - if ($save->isFinished()) { |
|
59 | + if($save->isFinished()) { |
|
60 | 60 | do |
61 | 61 | { |
62 | 62 | $hash = strtolower(str_random(15)); |
63 | 63 | $dup = FileLinks::where('link_hash', $hash)->get()->count(); |
64 | - }while($dup != 0); |
|
64 | + } while($dup != 0); |
|
65 | 65 | |
66 | 66 | // Create the new file link |
67 | 67 | $link = FileLinks::create([ |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ]); |
74 | 74 | $linkID = $link->link_id; |
75 | 75 | |
76 | - $fileID = $this->newLinkFile($save->getFile(), $linkID); |
|
76 | + $fileID = $this->newLinkFile($save->getFile(), $linkID); |
|
77 | 77 | |
78 | 78 | // Place the file in the file link files table of DB |
79 | 79 | FileLinkFiles::create([ |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | $hash = strtolower(str_random(15)); |
102 | 102 | $dup = FileLinks::where('link_hash', $hash)->get()->count(); |
103 | - }while($dup != 0); |
|
103 | + } while($dup != 0); |
|
104 | 104 | |
105 | 105 | // Create the new file link |
106 | 106 | $link = FileLinks::create([ |
@@ -215,14 +215,14 @@ discard block |
||
215 | 215 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
216 | 216 | |
217 | 217 | // check if the upload is success, throw exception or return response you need |
218 | - if ($receiver->isUploaded() === false) { |
|
218 | + if($receiver->isUploaded() === false) { |
|
219 | 219 | throw new UploadMissingFileException(); |
220 | 220 | } |
221 | 221 | |
222 | 222 | // receive the file |
223 | 223 | $save = $receiver->receive(); |
224 | 224 | // check if the upload has finished (in chunk mode it will send smaller files) |
225 | - if ($save->isFinished()) { |
|
225 | + if($save->isFinished()) { |
|
226 | 226 | return $this->saveFile($save->getFile(), $id); |
227 | 227 | } |
228 | 228 | // we are in chunk mode, lets send the current progress |
@@ -49,14 +49,16 @@ discard block |
||
49 | 49 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
50 | 50 | |
51 | 51 | // check if the upload is success, throw exception or return response you need |
52 | - if ($receiver->isUploaded() === false) { |
|
52 | + if ($receiver->isUploaded() === false) |
|
53 | + { |
|
53 | 54 | throw new UploadMissingFileException(); |
54 | 55 | } |
55 | 56 | |
56 | 57 | // receive the file |
57 | 58 | $save = $receiver->receive(); |
58 | 59 | // check if the upload has finished (in chunk mode it will send smaller files) |
59 | - if ($save->isFinished()) { |
|
60 | + if ($save->isFinished()) |
|
61 | + { |
|
60 | 62 | do |
61 | 63 | { |
62 | 64 | $hash = strtolower(str_random(15)); |
@@ -215,14 +217,16 @@ discard block |
||
215 | 217 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
216 | 218 | |
217 | 219 | // check if the upload is success, throw exception or return response you need |
218 | - if ($receiver->isUploaded() === false) { |
|
220 | + if ($receiver->isUploaded() === false) |
|
221 | + { |
|
219 | 222 | throw new UploadMissingFileException(); |
220 | 223 | } |
221 | 224 | |
222 | 225 | // receive the file |
223 | 226 | $save = $receiver->receive(); |
224 | 227 | // check if the upload has finished (in chunk mode it will send smaller files) |
225 | - if ($save->isFinished()) { |
|
228 | + if ($save->isFinished()) |
|
229 | + { |
|
226 | 230 | return $this->saveFile($save->getFile(), $id); |
227 | 231 | } |
228 | 232 | // we are in chunk mode, lets send the current progress |
@@ -66,14 +66,14 @@ |
||
66 | 66 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
67 | 67 | |
68 | 68 | // check if the upload is success, throw exception or return response you need |
69 | - if ($receiver->isUploaded() === false) { |
|
69 | + if($receiver->isUploaded() === false) { |
|
70 | 70 | throw new UploadMissingFileException(); |
71 | 71 | } |
72 | 72 | |
73 | 73 | // receive the file |
74 | 74 | $save = $receiver->receive(); |
75 | 75 | // check if the upload has finished (in chunk mode it will send smaller files) |
76 | - if ($save->isFinished()) |
|
76 | + if($save->isFinished()) |
|
77 | 77 | { |
78 | 78 | // Get the folder location for the system |
79 | 79 | $folder = SystemTypes::where('name', $request['system'])->first()->folder_location; |
@@ -33,11 +33,9 @@ discard block |
||
33 | 33 | // Ajax load to load the file for the system |
34 | 34 | public function loadFiles($sysName, $fileType) |
35 | 35 | { |
36 | - $fileList = SystemFiles::whereHas('SystemTypes', function($q) use($sysName) |
|
37 | - { |
|
36 | + $fileList = SystemFiles::whereHas('SystemTypes', function($q) use($sysName) { |
|
38 | 37 | $q->where('name', urldecode($sysName)); |
39 | - })->whereHas('SystemFileTypes', function($q) use($fileType) |
|
40 | - { |
|
38 | + })->whereHas('SystemFileTypes', function($q) use($fileType) { |
|
41 | 39 | $q->where('description', urldecode($fileType)); |
42 | 40 | })->with('user')->with('files')->get(); |
43 | 41 | |
@@ -66,14 +64,15 @@ discard block |
||
66 | 64 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
67 | 65 | |
68 | 66 | // check if the upload is success, throw exception or return response you need |
69 | - if ($receiver->isUploaded() === false) { |
|
67 | + if ($receiver->isUploaded() === false) |
|
68 | + { |
|
70 | 69 | throw new UploadMissingFileException(); |
71 | 70 | } |
72 | 71 | |
73 | 72 | // receive the file |
74 | 73 | $save = $receiver->receive(); |
75 | 74 | // check if the upload has finished (in chunk mode it will send smaller files) |
76 | - if ($save->isFinished()) |
|
75 | + if ($save->isFinished()) |
|
77 | 76 | { |
78 | 77 | // Get the folder location for the system |
79 | 78 | $folder = SystemTypes::where('name', $request['system'])->first()->folder_location; |
@@ -56,14 +56,14 @@ |
||
56 | 56 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
57 | 57 | |
58 | 58 | // check if the upload is success, throw exception or return response you need |
59 | - if ($receiver->isUploaded() === false) { |
|
59 | + if($receiver->isUploaded() === false) { |
|
60 | 60 | throw new UploadMissingFileException(); |
61 | 61 | } |
62 | 62 | |
63 | 63 | // receive the file |
64 | 64 | $save = $receiver->receive(); |
65 | 65 | // check if the upload has finished (in chunk mode it will send smaller files) |
66 | - if ($save->isFinished()) { |
|
66 | + if($save->isFinished()) { |
|
67 | 67 | |
68 | 68 | |
69 | 69 | $fileID = $this->saveFile($save->getFile(), $filePath); |
@@ -56,14 +56,16 @@ |
||
56 | 56 | $receiver = new FileReceiver("file", $request, HandlerFactory::classFromRequest($request)); |
57 | 57 | |
58 | 58 | // check if the upload is success, throw exception or return response you need |
59 | - if ($receiver->isUploaded() === false) { |
|
59 | + if ($receiver->isUploaded() === false) |
|
60 | + { |
|
60 | 61 | throw new UploadMissingFileException(); |
61 | 62 | } |
62 | 63 | |
63 | 64 | // receive the file |
64 | 65 | $save = $receiver->receive(); |
65 | 66 | // check if the upload has finished (in chunk mode it will send smaller files) |
66 | - if ($save->isFinished()) { |
|
67 | + if ($save->isFinished()) |
|
68 | + { |
|
67 | 69 | |
68 | 70 | |
69 | 71 | $fileID = $this->saveFile($save->getFile(), $filePath); |