Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
120fe191
Commit
120fe191
authored
Aug 18, 2023
by
PedroLopesUPE
Browse files
Adição da função de salvar PDF em sistema
parent
ff346de2
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/UserPadController.php
View file @
120fe191
...
...
@@ -118,12 +118,15 @@ class UserPadController extends Controller
}
/**
*
G
enerate PDF, with a given user_pad_id
*
Return g
enerate
d
PDF, with a given user_pad_id
;
*
* Additionally, if a filename is given, function will save PDF in storage;
*
* @param integer $user_pad_id
* @param string $fileName
* @return \Illuminate\Http\Response
*/
public
function
generatePDF
(
$user_pad_id
)
public
function
generatePDF
(
$user_pad_id
,
$fileName
=
""
)
{
$niveis
=
Nivel
::
listNivel
();
$funcoes
=
Funcao
::
listFuncaoEnsino
()
+
...
...
@@ -400,6 +403,14 @@ class UserPadController extends Controller
$pdf_name
=
" Relatório PAD - "
.
$userPad
->
user
->
{
'name'
};
$pdf
=
PDF
::
loadView
(
'pad.teacher.report_pdf'
,
$data
);
return
$pdf
->
download
(
$pdf_name
.
".pdf"
);
if
(
$fileName
==
""
)
{
return
$pdf
->
download
(
$pdf_name
.
".pdf"
);
}
else
{
$pdf
->
save
(
$fileName
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment