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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user