Skip to content

Commit 263e015

Browse files
committed
feat: add global 'no sandbox' option
1 parent 359bdc8 commit 263e015

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

config/laravel-pdf.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
* Other Browsershot configuration options.
2424
*/
2525
'write_options_to_file' => env('LARAVEL_PDF_WRITE_OPTIONS_TO_FILE', false),
26+
'no_sandbox' => env('LARAVEL_PDF_NO_SANDBOX', false),
2627
],
2728
];

docs/advanced-usage/configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Configure paths to Node.js, npm, Chrome, and other binaries:
3333
'bin_path' => env('LARAVEL_PDF_BIN_PATH'),
3434
'temp_path' => env('LARAVEL_PDF_TEMP_PATH'),
3535
'write_options_to_file' => env('LARAVEL_PDF_WRITE_OPTIONS_TO_FILE', false),
36+
'no_sandbox' => env('LARAVEL_PDF_NO_SANDBOX', false),
3637
],
3738
```
3839

@@ -50,6 +51,7 @@ LARAVEL_PDF_NODE_MODULES_PATH=/path/to/node_modules
5051
LARAVEL_PDF_BIN_PATH=/usr/local/bin
5152
LARAVEL_PDF_TEMP_PATH=/tmp
5253
LARAVEL_PDF_WRITE_OPTIONS_TO_FILE=true
54+
LARAVEL_PDF_NO_SANDBOX=true
5355
```
5456

5557
## Overriding Configuration

src/PdfBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@ protected function applyConfigurationDefaults(Browsershot $browsershot): void
420420
if (config('laravel-pdf.browsershot.write_options_to_file')) {
421421
$browsershot->writeOptionsToFile();
422422
}
423+
424+
if (config('laravel-pdf.browsershot.no_sandbox')) {
425+
$browsershot->noSandbox();
426+
}
423427
}
424428

425429
public function toResponse($request): Response

0 commit comments

Comments
 (0)