Add Pdf-viewer endpoint
This commit is contained in:
parent
965160d1cc
commit
9da0666c05
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class HelperController extends Controller
|
||||||
|
{
|
||||||
|
public function pdfView(Request $request)
|
||||||
|
{
|
||||||
|
$this->validate($request, [
|
||||||
|
'url' => 'required|string'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$url = $request->input('url');
|
||||||
|
return view('pdf-viewer', compact('url'));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<title>PDF Viewer</title>
|
||||||
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
margin: 0; /* Reset default margin */
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe {
|
||||||
|
display: block; /* iframes are inline by default */
|
||||||
|
/*background: #000;*/
|
||||||
|
border: none; /* Reset default border */
|
||||||
|
height: 100vh; /* Viewport-relative units */
|
||||||
|
width: 100vw;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<iframe src="{{$url}}#toolbar=0"></iframe>
|
||||||
|
{{--<object data="{{$url}}" type="application/pdf">--}}
|
||||||
|
{{-- <div>No online PDF viewer installed</div>--}}
|
||||||
|
{{--</object>--}}
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -55,6 +55,7 @@ $router->group(['prefix' => '', 'middleware' => 'auth'], function () use ($route
|
||||||
|
|
||||||
$router->get('invoices', 'InvoiceController@getInvoices');
|
$router->get('invoices', 'InvoiceController@getInvoices');
|
||||||
$router->get('generate-invoice', 'InvoiceController@generateInvoice');
|
$router->get('generate-invoice', 'InvoiceController@generateInvoice');
|
||||||
|
$router->get('pdf-viewer', 'HelperController@pdfView');
|
||||||
|
|
||||||
$router->get('authorizations-care-requests', 'AuthorizationCareRequestController@getAll');
|
$router->get('authorizations-care-requests', 'AuthorizationCareRequestController@getAll');
|
||||||
$router->post('authorizations-care-requests', 'AuthorizationCareRequestController@store');
|
$router->post('authorizations-care-requests', 'AuthorizationCareRequestController@store');
|
||||||
|
|
Loading…
Reference in New Issue