@@ -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,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 |
@@ -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,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); |