Files
verifikator/app/Services/GoogleDriveService.php
T
2026-09-15 14:42:01 +07:00

34 lines
852 B
PHP

<?php
namespace App\Services;
use Illuminate\Support\Facades\Log;
use Throwable;
class GoogleDriveService
{
// TODO: isi path credentials service account (JSON) & folder ID tujuan setelah tersedia.
private string $credentialsPath = '';
private string $folderId = '';
public function uploadPdf(string $content, string $fileName): string|false
{
if (! $this->credentialsPath || ! $this->folderId) {
Log::error("GoogleDriveService: belum dikonfigurasi, upload '$fileName' dilewati.");
return false;
}
try {
// TODO: implementasi upload pakai google/apiclient setelah credentials tersedia.
} catch (Throwable $th) {
Log::error('GoogleDriveService uploadPdf : '.$th->getMessage());
return false;
}
return false;
}
}