Update
parent
a037f82a5f
commit
01a057bfc8
|
|
@ -148,8 +148,13 @@ class DeviceLogSyncCommand extends Command
|
|||
if ($ext = pathinfo($item['url'], PATHINFO_EXTENSION)) {
|
||||
$name .= ".{$ext}";
|
||||
}
|
||||
|
||||
$path = "{$dir}/{$name}";
|
||||
|
||||
$disk = Storage::disk('public');
|
||||
if (! $disk->exists($path)) {
|
||||
$disk->put($path, file_get_contents($item['url']));
|
||||
}
|
||||
|
||||
WormPhoto::firstOrCreate([
|
||||
'device_id' => $device->id,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class WormPhotoResource extends JsonResource
|
|||
return [
|
||||
'id' => $this->id,
|
||||
'url' => $this->image_url,
|
||||
'time' => $this->created_at->toDateTimeString(),
|
||||
'time' => $this->uploaded_at->toDateTimeString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue