@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | public function storeSingle() |
| 14 | 14 | { |
| 15 | 15 | if (Request::hasFile('image')) { |
| 16 | - $fileData = Request::file('image'); |
|
| 16 | + $fileData = Request::file('image'); |
|
| 17 | 17 | //$fileData = Image::make($file)->encode('jpg', 80); |
| 18 | 18 | |
| 19 | 19 | $date = Carbon::now(); |
| 20 | 20 | $folderName = $date->hour . ':' . $date->minute . ':' . $date->second; |
| 21 | 21 | |
| 22 | 22 | $newFilename = \App::environment() . '/cctv/' . $date->year . '/' . $date->month . '/' . $date->day . '/' . $folderName . '/' . str_random() . '.jpg'; |
| 23 | - Storage::put($newFilename, (string) $fileData, 'public'); |
|
| 23 | + Storage::put($newFilename, (string)$fileData, 'public'); |
|
| 24 | 24 | |
| 25 | 25 | \Slack::to("#cctv")->attach(['image_url'=>'https://s3-eu-west-1.amazonaws.com/buildbrighton-bbms/' . $newFilename, 'color'=>'warning'])->send('New image'); |
| 26 | 26 | } else { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | 'ContentType' => 'image/jpg', |
| 62 | 62 | 'ServerSideEncryption' => 'AES256', |
| 63 | 63 | )); |
| 64 | - } catch(\Exception $e) { |
|
| 64 | + } catch (\Exception $e) { |
|
| 65 | 65 | \Log::exception($e); |
| 66 | 66 | } |
| 67 | 67 | //Log::debug('Image saved :https://s3-eu-west-1.amazonaws.com/buildbrighton-bbms/'.$newFilename); |