Files
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

27 lines
756 B
PHP

<?php
namespace App\Http\Controllers\Impressao\Ambulatorio;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Storage;
class ImpressaoAssinadoController extends Controller
{
public function __invoke($atendimentoId)
{
$path = 'assinatura-eletronica' . DIRECTORY_SEPARATOR . app('config')->get('database.default') . DIRECTORY_SEPARATOR . 'ambulatorio' . DIRECTORY_SEPARATOR . 'atendimento';
$fileName = request()->tipo;
$arquivo = "{$fileName}-{$atendimentoId}.PDF";
$headers = [
'Content-Type' => 'application/pdf',
];
$filePath = Storage::path( $path . DIRECTORY_SEPARATOR . $arquivo);
return response()->download($filePath, $arquivo, $headers);
}
}