Files
ladill-transfer/app/Support/DirectTransferFileUrl.php
T
isaaccladandCursor ccffa1433d
Deploy Ladill Transfer / deploy (push) Successful in 28s
Route SMS voice uploads through Transfer with wallet billing.
Add a service API for the Ladill SMS platform to store voice recordings in Transfer and charge monthly storage from the customer wallet.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-20 02:23:18 +00:00

22 lines
537 B
PHP

<?php
namespace App\Support;
use App\Models\QrCode;
use App\Models\Transfer;
use App\Models\TransferFile;
use RuntimeException;
class DirectTransferFileUrl
{
public static function for(Transfer $transfer, TransferFile $file): string
{
$shortCode = $transfer->qrCode?->short_code;
if ($shortCode === null || $shortCode === '') {
throw new RuntimeException('Transfer file URL is unavailable.');
}
return QrCode::publicBaseUrl().'/q/'.$shortCode.'/transfer/files/'.$file->id;
}
}