We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 179-189 (lines=11) @@ | ||
| 176 | } |
|
| 177 | ||
| 178 | // if a new file is uploaded, store it on disk and its filename in the database |
|
| 179 | if ($request->hasFile($attribute_name) && $request->file($attribute_name)->isValid()) { |
|
| 180 | // 1. Generate a new file name |
|
| 181 | $file = $request->file($attribute_name); |
|
| 182 | $new_file_name = md5($file->getClientOriginalName().time()).'.'.$file->getClientOriginalExtension(); |
|
| 183 | ||
| 184 | // 2. Move the new file to the correct path |
|
| 185 | $file_path = $file->storeAs($destination_path, $new_file_name, $disk); |
|
| 186 | ||
| 187 | // 3. Save the complete path to the database |
|
| 188 | $this->attributes[$attribute_name] = $file_path; |
|
| 189 | } |
|
| 190 | } |
|
| 191 | ||
| 192 | /** |
|
| @@ 226-239 (lines=14) @@ | ||
| 223 | } |
|
| 224 | ||
| 225 | // if a new file is uploaded, store it on disk and its filename in the database |
|
| 226 | if ($request->hasFile($attribute_name)) { |
|
| 227 | foreach ($request->file($attribute_name) as $file) { |
|
| 228 | if ($file->isValid()) { |
|
| 229 | // 1. Generate a new file name |
|
| 230 | $new_file_name = md5($file->getClientOriginalName().time()).'.'.$file->getClientOriginalExtension(); |
|
| 231 | ||
| 232 | // 2. Move the new file to the correct path |
|
| 233 | $file_path = $file->storeAs($destination_path, $new_file_name, $disk); |
|
| 234 | ||
| 235 | // 3. Add the public path to the database |
|
| 236 | $attribute_value[] = $file_path; |
|
| 237 | } |
|
| 238 | } |
|
| 239 | } |
|
| 240 | ||
| 241 | $this->attributes[$attribute_name] = json_encode($attribute_value); |
|
| 242 | } |
|