Add PDF preview feature and improve permohonan management

Introduced a "Preview" button for jaminan documents to view PDFs directly. Refactored Permohonan management to include a show view and print functionality, and updated relevant views and routes accordingly.
This commit is contained in:
Daeng Deni Mardaeni
2024-10-31 14:14:48 +07:00
parent 5343c424b1
commit 1d1492b636
6 changed files with 44 additions and 30 deletions

View File

@@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller;
use Barryvdh\DomPDF\Facade\Pdf;
use Exception;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
@@ -304,4 +305,19 @@
return redirect()->route('authorization.index')->with('success', 'Permohonan updated successfully');
}
public function show($id)
{
$permohonan = Permohonan::find($id);
return view('lpj::permohonan.show', compact('permohonan'));
}
public function print($id){
$permohonan = Permohonan::find($id);
return view('lpj::permohonan.print', compact('permohonan'));
// $pdf = Pdf::loadView('lpj::permohonan.print', compact('permohonan'));
// return $pdf->stream();
}
}