Skip to content

Commit

Permalink
Daffa Haidar - Convert Student Data to PDF Stage 2
Browse files Browse the repository at this point in the history
  • Loading branch information
daffahaidar committed Aug 26, 2022
1 parent 57e55d2 commit 56cbf3c
Show file tree
Hide file tree
Showing 8 changed files with 175 additions and 164 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
| **23 August 2022** | Completed Edit Student Data |
| **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 |
| **Next...** | coming soon... |

## Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ 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);
$pdf->SetProtection(['copy', 'print'], '', 'pass');
return $pdf->stream('document.pdf');
// $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);
}
}
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"laravel/jetstream": "^2.8",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7",
"livewire/livewire": "^2.5",
"niklasravnsborg/laravel-pdf": "*"
"livewire/livewire": "^2.5"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
Expand Down
161 changes: 6 additions & 155 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
niklasravnsborg\LaravelPdf\PdfServiceProvider::class,

/*
* Package Service Providers...
Expand Down Expand Up @@ -213,7 +212,6 @@

'aliases' => Facade::defaultAliases()->merge([
// 'ExampleClass' => App\Example\ExampleClass::class,
'PDF' => niklasravnsborg\LaravelPdf\Facades\Pdf::class,
])->toArray(),

];
Loading

0 comments on commit 56cbf3c

Please sign in to comment.