We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 129-140 (lines=12) @@ | ||
| 126 | } |
|
| 127 | ||
| 128 | // if a new file is uploaded, store it on disk and its filename in the database |
|
| 129 | if ($request->hasFile($attribute_name) && $request->file($attribute_name)->isValid()) { |
|
| 130 | ||
| 131 | // 1. Generate a new file name |
|
| 132 | $file = $request->file($attribute_name); |
|
| 133 | $new_file_name = md5($file->getClientOriginalName().time()).'.'.$file->getClientOriginalExtension(); |
|
| 134 | ||
| 135 | // 2. Move the new file to the correct path |
|
| 136 | $file_path = $file->storeAs($destination_path, $new_file_name, $disk); |
|
| 137 | ||
| 138 | // 3. Save the complete path to the database |
|
| 139 | $this->attributes[$attribute_name] = $file_path; |
|
| 140 | } |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| @@ 177-190 (lines=14) @@ | ||
| 174 | } |
|
| 175 | ||
| 176 | // if a new file is uploaded, store it on disk and its filename in the database |
|
| 177 | if ($request->hasFile($attribute_name)) { |
|
| 178 | foreach ($request->file($attribute_name) as $file) { |
|
| 179 | if ($file->isValid()) { |
|
| 180 | // 1. Generate a new file name |
|
| 181 | $new_file_name = md5($file->getClientOriginalName().time()).'.'.$file->getClientOriginalExtension(); |
|
| 182 | ||
| 183 | // 2. Move the new file to the correct path |
|
| 184 | $file_path = $file->storeAs($destination_path, $new_file_name, $disk); |
|
| 185 | ||
| 186 | // 3. Add the public path to the database |
|
| 187 | $attribute_value[] = $file_path; |
|
| 188 | } |
|
| 189 | } |
|
| 190 | } |
|
| 191 | ||
| 192 | $this->attributes[$attribute_name] = json_encode($attribute_value); |
|
| 193 | } |
|