fix: static

This commit is contained in:
hashbro
2026-09-14 03:32:56 +08:00
parent c8d4eaa86e
commit d16c40cdb3
10 changed files with 134 additions and 33 deletions
+12 -4
View File
@@ -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));
}
}