You've already forked isop-mirror
feat: implement PDF generation for default agreement
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\Internship;
|
|||||||
use App\Models\InternshipStatus;
|
use App\Models\InternshipStatus;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Mpdf\Mpdf;
|
||||||
|
|
||||||
class InternshipController extends Controller
|
class InternshipController extends Controller
|
||||||
{
|
{
|
||||||
@@ -85,9 +86,14 @@ class InternshipController extends Controller
|
|||||||
'student_address' => "Hlavná 123, Nitra",
|
'student_address' => "Hlavná 123, Nitra",
|
||||||
])->render();
|
])->render();
|
||||||
|
|
||||||
return response($html, 200)
|
$pdf = new Mpdf([
|
||||||
->header('Content-Type', 'application/html')
|
'orientation' => 'P'
|
||||||
->header('Content-Disposition', 'attachment; filename="agreement_' . $id . '.html"');
|
]);
|
||||||
|
$pdf->WriteHTML($html);
|
||||||
|
|
||||||
|
return response($pdf->Output('', 'S'), 200)
|
||||||
|
->header('Content-Type', 'application/pdf')
|
||||||
|
->header('Content-Disposition', 'attachment; filename="agreement_' . $id . '.pdf"');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_agreement(int $id)
|
public function get_agreement(int $id)
|
||||||
|
|||||||
Reference in New Issue
Block a user