Skip to content

Commit

Permalink
trx and pdf unfinished
Browse files Browse the repository at this point in the history
  • Loading branch information
AndikaHilmiHamdani committed May 25, 2022
1 parent cbd956f commit 460f827
Show file tree
Hide file tree
Showing 8 changed files with 365 additions and 7 deletions.
9 changes: 9 additions & 0 deletions app/Http/Controllers/MidtransController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use PDF;

class MidtransController extends Controller
{
Expand Down Expand Up @@ -108,4 +109,12 @@ public function store(Request $request)

return $order;
}

public function cetakpdf()
{

$order = Order::all();
$pdf = PDF::loadview('users.manajer.cetakpdf',compact('order'));
return $pdf->stream();
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "MIT",
"require": {
"php": "^8.0.2",
"barryvdh/laravel-dompdf": "^1.0",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.2",
"laravel/sanctum": "^2.14.1",
Expand Down
290 changes: 289 additions & 1 deletion composer.lock

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

4 changes: 4 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@

//user
Spatie\Permission\PermissionServiceProvider::class,

//PDF
Barryvdh\DomPDF\ServiceProvider::class,
],

/*
Expand All @@ -194,6 +197,7 @@

'aliases' => Facade::defaultAliases()->merge([
// ...
'PDF' => Barryvdh\DomPDF\Facade::class,
])->toArray(),

];
2 changes: 1 addition & 1 deletion resources/views/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</div>
<div class="grid grid-cols-2 gap-4">
<div class="col-end-2 row-start-1">
<a href="">
<a href="/cetak">
<p class="text-2xl">Cetak Laporan</p>
</a>
</div>
Expand Down
Loading

0 comments on commit 460f827

Please sign in to comment.