Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit d5c140b

Browse files
committed
Add text alignment to toolbar by default
1 parent 20a3148 commit d5c140b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Dto/QuillOptions.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class QuillOptions
2727
public bool $link = true;
2828
public bool $image = false;
2929
public bool $clearFormatting = true;
30+
public bool $alignments = true;
3031
public array $customToolbarButtons = [];
3132
public array $toolbarHandlers = [];
3233

@@ -187,6 +188,13 @@ public function hideLink(): self
187188
return $this;
188189
}
189190

191+
public function hideAlignments(): self
192+
{
193+
$this->alignments = false;
194+
195+
return $this;
196+
}
197+
190198
public function showImage(): self
191199
{
192200
$this->image = true;
@@ -224,6 +232,7 @@ public function getToolbar(): array
224232
$this->scripts ? [['script' => 'super'], ['script' => 'sub']] : null,
225233
$this->quoteToolbar(),
226234
$this->listToolbar(),
235+
$this->alignments ? [['align' => ['', 'center', 'right', 'justify']]] : null,
227236
$this->linkToolbar(),
228237
$this->clearFormatting ? ['clean'] : null,
229238
$this->customToolbarButtons,

0 commit comments

Comments
 (0)