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