Skip to content

Commit

Permalink
Daffa Haidar - Convert Student Data to PDF Stage 1
Browse files Browse the repository at this point in the history
  • Loading branch information
daffahaidar committed Aug 25, 2022
1 parent 28ee22f commit 57e55d2
Show file tree
Hide file tree
Showing 8 changed files with 517 additions and 480 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
| **22 August 2022** | Edit Student Data Stage 2 |
| **23 August 2022** | Completed Edit Student Data |
| **24 August 2022** | Create Student Promotion Feature |
| **25 August 2022** | Convert Student Data to PDF Stage 1 |
| **Next...** | coming soon... |

## Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use App\Models\StudentYear;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use PDF;

class StudentRegistrationController extends Controller
{
Expand Down Expand Up @@ -229,4 +230,13 @@ public function StudentUpdatePromotion(Request $request, $student_id)

return redirect()->route('student.registration.view')->with($notification);
}

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');
}
}
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^8.0.2",
"php": "^7.3|^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.11",
"laravel/jetstream": "^2.8",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7",
"livewire/livewire": "^2.5"
"livewire/livewire": "^2.5",
"niklasravnsborg/laravel-pdf": "*"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
Expand Down
Loading

0 comments on commit 57e55d2

Please sign in to comment.