このコミットが含まれているのは:
守矢諏訪子 2021-11-01 16:23:03 +09:00
コミット 12052e4189

ファイルの表示

@ -526,18 +526,20 @@ class MeetingsController extends Controller {
if (isset($r->pdf)) {
$filename = uniqid() . '.pdf';
$pdf = base64_decode(substr($r->pdf, strpos($r->pdf, ',') + 1));
$update['pdf'] = '/storage/'.$filename;
if ($chk = Meeting::select('pdf')->where('id', (int)$meeting_id)->first()) {
if (strcmp($chk->pdf, $pdf) !== 0) {
if (Storage::disk('public')->exists($chk->pdf)) {
Storage::disk('public')->delete($chk->pdf);
$opdf = str_replace('storage/', '', $chk->pdf);
if (strcmp(Storage::disk('public')->get($opdf), $pdf) !== 0) {
if (Storage::disk('public')->exists($opdf)) {
Storage::disk('public')->delete($opdf);
}
$update['pdf'] = '/storage/'.$filename;
Storage::disk('public')->put($filename, $pdf);
}
}
else {
$update['pdf'] = '/storage/'.$filename;
Storage::disk('public')->put($filename, $pdf);
}
}