We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ 251-261 (lines=11) @@ | ||
248 | } |
|
249 | ||
250 | // if a new file is uploaded, store it on disk and its filename in the database |
|
251 | if (request()->hasFile($attribute_name) && request()->file($attribute_name)->isValid()) { |
|
252 | // 1. Generate a new file name |
|
253 | $file = request()->file($attribute_name); |
|
254 | $new_file_name = md5($file->getClientOriginalName().random_int(1, 9999).time()).'.'.$file->getClientOriginalExtension(); |
|
255 | ||
256 | // 2. Move the new file to the correct path |
|
257 | $file_path = $file->storeAs($destination_path, $new_file_name, $disk); |
|
258 | ||
259 | // 3. Save the complete path to the database |
|
260 | $this->attributes[$attribute_name] = $file_path; |
|
261 | } |
|
262 | } |
|
263 | ||
264 | /** |
|
@@ 300-313 (lines=14) @@ | ||
297 | } |
|
298 | ||
299 | // if a new file is uploaded, store it on disk and its filename in the database |
|
300 | if (request()->hasFile($attribute_name)) { |
|
301 | foreach (request()->file($attribute_name) as $file) { |
|
302 | if ($file->isValid()) { |
|
303 | // 1. Generate a new file name |
|
304 | $new_file_name = md5($file->getClientOriginalName().random_int(1, 9999).time()).'.'.$file->getClientOriginalExtension(); |
|
305 | ||
306 | // 2. Move the new file to the correct path |
|
307 | $file_path = $file->storeAs($destination_path, $new_file_name, $disk); |
|
308 | ||
309 | // 3. Add the public path to the database |
|
310 | $attribute_value[] = $file_path; |
|
311 | } |
|
312 | } |
|
313 | } |
|
314 | ||
315 | $this->attributes[$attribute_name] = json_encode($attribute_value); |
|
316 | } |