Penambahan Sementara Pengajuan Presensi WhatsApp
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user