Conditions | 5 |
Paths | 6 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function __construct($source, $destinationPath = null) |
||
35 | { |
||
36 | if($source instanceof Model && $source instanceof UploadTarget) { |
||
37 | $this->sourcePath = $source->upload_source_path; |
||
38 | $this->destinationPath = $destinationPath ?: $source->upload_destination_path; |
||
39 | $this->target = $source; |
||
40 | } else { |
||
41 | $this->sourcePath = $source; |
||
42 | $this->destinationPath = $destinationPath; |
||
43 | } |
||
44 | |||
45 | $this->destinationPath = Str::start($this->destinationPath, "/"); |
||
46 | |||
47 | if (Str::startsWith($this->sourcePath, "s3://")) { |
||
48 | app('aws')->createClient('s3')->registerStreamWrapper(); |
||
49 | } |
||
50 | } |
||
51 | |||
75 | } |