Skip to content

Commit 11ec62b

Browse files
committed
fix: default empty array on stack_stylesheets config, added construct to init collect data and setPageCounterText()
1 parent a63ad3e commit 11ec62b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

resources/views/defaultLayout.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<html>
22
<head>
3-
@foreach (config('pdf-manager.stack_stylesheets') as $stylesheet)
3+
@foreach (config('pdf-manager.stack_stylesheets', []) as $stylesheet)
44
<link rel="stylesheet" type="text/css" href="{{ $stylesheet }}">
55
@endforeach
66
<style>

src/PdfManager.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class PdfManager
3131
PDF_CONTENT = 'pdf_content',
3232
PDF_DEBUG_VIEW = 'debug_view';
3333

34+
public function __construct()
35+
{
36+
$this->data = collect();
37+
}
38+
3439
public function setData(array $data): self
3540
{
3641
$this->data = collect($data);
@@ -100,6 +105,13 @@ public function setPageCounter(?int $pageCounterX = null, ?int $pageCounterY = n
100105
return $this;
101106
}
102107

108+
public function setPageCounterText(?string $pageCounterText = null): self
109+
{
110+
$this->pageCounterText = $pageCounterText;
111+
112+
return $this;
113+
}
114+
103115
public function getPageCounterX(): float
104116
{
105117
return (float) ($this->pageCounterX ?? config('pdf-manager.page_counter.x', 10));

0 commit comments

Comments
 (0)