@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | protected function isFileDup($fileName) |
| 72 | 72 | { |
| 73 | 73 | // Determine if the filename already exists |
| 74 | - if (Storage::exists($this->path . DIRECTORY_SEPARATOR . $fileName)) |
|
| 74 | + if(Storage::exists($this->path.DIRECTORY_SEPARATOR.$fileName)) |
|
| 75 | 75 | { |
| 76 | 76 | $fileParts = pathinfo($fileName); |
| 77 | - $extension = isset($fileParts['extension']) ? ('.' . $fileParts['extension']) : ''; |
|
| 77 | + $extension = isset($fileParts['extension']) ? ('.'.$fileParts['extension']) : ''; |
|
| 78 | 78 | |
| 79 | 79 | // Look to see if a number is already appended to a file. (example - file(1).pdf) |
| 80 | - if (preg_match('/(.*?)(\d+)$/', $fileParts['filename'], $match)) |
|
| 80 | + if(preg_match('/(.*?)(\d+)$/', $fileParts['filename'], $match)) |
|
| 81 | 81 | { |
| 82 | 82 | // Has a number, increment it |
| 83 | 83 | $base = $match[1]; |
@@ -93,8 +93,8 @@ discard block |
||
| 93 | 93 | // Increase the number until one that is not in use is found |
| 94 | 94 | do |
| 95 | 95 | { |
| 96 | - $fileName = $base . '(' . ++$number . ')' . $extension; |
|
| 97 | - } while (Storage::exists($this->path.DIRECTORY_SEPARATOR.$fileName)); |
|
| 96 | + $fileName = $base.'('.++$number.')'.$extension; |
|
| 97 | + } while(Storage::exists($this->path.DIRECTORY_SEPARATOR.$fileName)); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | return $fileName; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $data = Files::find($fileID); |
| 107 | 107 | // Move the file to the proper folder |
| 108 | - try{ |
|
| 108 | + try { |
|
| 109 | 109 | |
| 110 | 110 | Storage::move($data->file_link.$data->file_name, $newPath.DIRECTORY_SEPARATOR.$data->file_name); |
| 111 | 111 | } |
@@ -105,7 +105,8 @@ |
||
| 105 | 105 | { |
| 106 | 106 | $data = Files::find($fileID); |
| 107 | 107 | // Move the file to the proper folder |
| 108 | - try{ |
|
| 108 | + try |
|
| 109 | + { |
|
| 109 | 110 | |
| 110 | 111 | Storage::move($data->file_link.$data->file_name, $newPath.DIRECTORY_SEPARATOR.$data->file_name); |
| 111 | 112 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | ->withCount('FileLinkFiles') |
| 26 | 26 | ->orderBy('expire', 'desc')->get(); |
| 27 | 27 | |
| 28 | - if ($this->collection) { |
|
| 28 | + if($this->collection) { |
|
| 29 | 29 | return new FileLinksCollection($links); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -25,7 +25,8 @@ |
||
| 25 | 25 | ->withCount('FileLinkFiles') |
| 26 | 26 | ->orderBy('expire', 'desc')->get(); |
| 27 | 27 | |
| 28 | - if ($this->collection) { |
|
| 28 | + if ($this->collection) |
|
| 29 | + { |
|
| 29 | 30 | return new FileLinksCollection($links); |
| 30 | 31 | } |
| 31 | 32 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | // Show the link details for the user |
| 26 | 26 | public function show($id) |
| 27 | 27 | { |
| 28 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by IP Address ' . \Request::ip()); |
|
| 28 | + Log::debug('Route '.Route::currentRouteName().' visited by IP Address '.\Request::ip()); |
|
| 29 | 29 | |
| 30 | 30 | $linkObj = new GetFileLinkDetails; |
| 31 | 31 | $linkID = $linkObj->getLinkID($id); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | // Show the files attached to a link |
| 44 | 44 | public function show($id) |
| 45 | 45 | { |
| 46 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 46 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 47 | 47 | |
| 48 | 48 | return (new GetFileLinkFiles)->execute($id, true); |
| 49 | 49 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | // Delete a file attached to a link |
| 63 | 63 | public function destroy($id) |
| 64 | 64 | { |
| 65 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name); |
|
| 65 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
|
| 66 | 66 | |
| 67 | 67 | (new SaveFileLinkFile)->deleteLinkFile($id); |
| 68 | 68 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name); |
| 46 | 46 | |
| 47 | 47 | // If the user is trying to access the links of another user, they must have the proper permissions permissions |
| 48 | - if ($id != 0) |
|
| 48 | + if($id != 0) |
|
| 49 | 49 | { |
| 50 | 50 | $this->authorize('hasAccess', 'manage_users'); |
| 51 | 51 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | // Update the instructions attached to the link |
| 133 | 133 | public function submitInstructions(UpdateFileLinkInstructionsRequest $request, $linkID) |
| 134 | 134 | { |
| 135 | - Log::debug('Route ' . Route::currentRouteName() . ' visited by ' . Auth::user()->full_name . '. Submitted Data - ', $request->toArray()); |
|
| 135 | + Log::debug('Route '.Route::currentRouteName().' visited by '.Auth::user()->full_name.'. Submitted Data - ', $request->toArray()); |
|
| 136 | 136 | |
| 137 | 137 | (new SetFileLinkDetails)->setLinkInstructions($request, $linkID); |
| 138 | 138 | |