Skip to content

Commit

Permalink
Daffa Haidar - Completed Convert Student Data to PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
daffahaidar committed Aug 26, 2022
1 parent 56cbf3c commit f9c780b
Show file tree
Hide file tree
Showing 4 changed files with 366 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
| **24 August 2022** | Create Student Promotion Feature |
| **25 August 2022** | Convert Student Data to PDF Stage 1 |
| **26 August 2022** | Convert Student Data to PDF Stage 2 |
| **27 August 2022** | Completed Convert Student Data to PDF |
| **Next...** | coming soon... |

## Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,10 @@ public function StudentUpdatePromotion(Request $request, $student_id)
public function StudentRegistrationDetails($student_id)
{
$data['details'] = AssignStudent::with(['student', 'discount'])->where('student_id', $student_id)->first();
$pdf = PDF::loadView('backend.student.student_registration.student_details_pdf', $data);
$student_name = $data['details']->student->name;
$student_id = $data['details']->student->id_no;

// $pdf = PDF::loadView('backend.student.student_registration.student_details_pdf', $data);
// $pdf->SetProtection(['copy', 'print'], '', 'pass');
// return $pdf->stream('document.pdf');

return view('backend.student.student_registration.student_details_pdf', $data);
return $pdf->download($student_id . ' - ' . $student_name . '.pdf');
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"license": "MIT",
"require": {
"php": "^7.3|^8.0.2",
"barryvdh/laravel-dompdf": "^2.0",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.11",
"laravel/jetstream": "^2.8",
Expand Down
Loading

0 comments on commit f9c780b

Please sign in to comment.