This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user