27 lines
756 B
PHP
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);
|
|
}
|
|
}
|