You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ $signed = false
30
30
31
31
Route::document(
32
32
"invoices/{id}",
33
-
"/invoices",
33
+
"invoices",
34
34
\App\Printables\Invoice::class,
35
35
[
36
36
// Middleware for getting the document
@@ -68,6 +68,7 @@ class Invoice extends DocumentAbstract
68
68
69
69
// Define the blade you want to return as printable document
70
70
public String $blade = "ambersive.documentviewer::printable_default";
71
+
public bool $useValidationEndpoint = false;
71
72
72
73
public function setData(){
73
74
// Request is available in $this->request
@@ -85,12 +86,24 @@ class Invoice extends DocumentAbstract
85
86
86
87
}
87
88
89
+
public function validateDocumentHandler(Request $request) {
90
+
91
+
// Handle the validation
92
+
// This information is a helper
93
+
// Requires a response (preferable json)
94
+
return ['status' => 200];
95
+
96
+
}
97
+
88
98
}
89
99
```
90
100
91
-
### Step 4: Generate a valid blade file
101
+
### Step 4: Modify the blade file
102
+
103
+
The make command also creates a blade file within the resource folder.
104
+
It will come with some basic scaffold settings so you will be able to create beautiful documents in no time.
92
105
93
-
Create a blade file. If you want to get our print optimizations you need to use our file document base layout
106
+
But you can also define or resource the files.
94
107
95
108
```php
96
109
@extends('ambersive.documentviewer::printable')
@@ -110,6 +123,10 @@ A full example might look like:
110
123
111
124
```
112
125
126
+
## Need a way to create PDF files?
127
+
128
+
We created a [microservice](https://github.com/AMBERSIVE/print-api) which is also open-source to create pdf files. If you need a smooth way to interact with this microservice you can use our [package](https://github.com/AMBERSIVE/laravel-print-api) for that.
129
+
113
130
## Security Vulnerabilities
114
131
115
132
If you discover a security vulnerability within this package, please send an e-mail to Manuel Pirker-Ihl via [[email protected]](mailto:[email protected]). All security vulnerabilities will be promptly addressed.
0 commit comments