We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 193-206 (lines=14) @@ | ||
| 190 | } |
|
| 191 | ||
| 192 | // if a new file is uploaded, store it on disk and its filename in the database |
|
| 193 | if ($request->hasFile($attribute_name)) { |
|
| 194 | foreach ($request->file($attribute_name) as $file) { |
|
| 195 | if ($file->isValid()) { |
|
| 196 | // 1. Generate a new file name |
|
| 197 | $new_file_name = md5($file->getClientOriginalName().time()).'.'.$file->getClientOriginalExtension(); |
|
| 198 | ||
| 199 | // 2. Move the new file to the correct path |
|
| 200 | $file_path = $file->storeAs($destination_path, $new_file_name, $disk); |
|
| 201 | ||
| 202 | // 3. Add the public path to the database |
|
| 203 | $attribute_value[] = $file_path; |
|
| 204 | } |
|
| 205 | } |
|
| 206 | } |
|
| 207 | ||
| 208 | $this->attributes[$attribute_name] = json_encode($attribute_value); |
|
| 209 | } |
|
| @@ 146-157 (lines=12) @@ | ||
| 143 | } |
|
| 144 | ||
| 145 | // if a new file is uploaded, store it on disk and its filename in the database |
|
| 146 | if ($request->hasFile($attribute_name) && $request->file($attribute_name)->isValid()) { |
|
| 147 | // 1. Generate a new file name |
|
| 148 | $file = $request->file($attribute_name); |
|
| 149 | $new_file_name = md5($file->getClientOriginalName().time()).'.'.$file->getClientOriginalExtension(); |
|
| 150 | ||
| 151 | // 2. Move the new file to the correct path |
|
| 152 | $file_path = $file->storeAs($destination_path, $new_file_name, $disk); |
|
| 153 | ||
| 154 | // 3. Save the complete path to the database |
|
| 155 | $this->attributes[$attribute_name] = $file_path; |
|
| 156 | } |
|
| 157 | } |
|
| 158 | ||
| 159 | /** |
|
| 160 | * Handle multiple file upload and DB storage: |
|