fix: static
This commit is contained in:
@@ -396,16 +396,24 @@ TXT;
|
||||
}
|
||||
});
|
||||
|
||||
return $this->storePhoto($device);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $attrs
|
||||
*/
|
||||
private function storePhoto(Device $device, array $attrs = []): Photo
|
||||
{
|
||||
$png = base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==');
|
||||
$rel = 'c2/photos/'.$device->device_id.'/test.png';
|
||||
$rel = 'c2/photos/'.$device->device_id.'/'.uniqid('p_', true).'.png';
|
||||
Storage::disk('local')->put($rel, $png);
|
||||
|
||||
return Photo::query()->create([
|
||||
return Photo::query()->create(array_merge([
|
||||
'device_id' => $device->id,
|
||||
'sha256' => hash('sha256', $png),
|
||||
'sha256' => hash('sha256', $png.uniqid('', true)),
|
||||
'path' => $rel,
|
||||
'size' => strlen($png),
|
||||
'scan_status' => MnemonicScanStatus::PENDING,
|
||||
]);
|
||||
], $attrs));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user