Skip to content

Commit

Permalink
fix: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Oct 19, 2024
1 parent faa65a1 commit c97e48a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ CKEditor::make('Label')
## Attachments

```php
CKEditor::make('Label')->attachmentRoute(route('your-attachment-route'))
CKEditor::make('Label')->attachmentEndpoint(route('your-attachment-route'))
```
2 changes: 1 addition & 1 deletion resources/views/fields/ckeditor.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<x-moonshine::form.textarea
::id="$id('ckeditor')"
x-data="ckeditor(`{{ $attachmentRoute }}`)"
x-data="ckeditor(`{{ $attachmentEndpoint }}`)"
:attributes="$attributes"
>{!! $value ?? '' !!}</x-moonshine::form.textarea>
8 changes: 4 additions & 4 deletions src/Fields/CKEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class CKEditor extends Textarea
{
protected string $view = 'moonshine-ckeditor::fields.ckeditor';

protected string $attachmentRoute = '';
protected string $attachmentEndpoint = '';

public function getAssets(): array
{
Expand All @@ -23,17 +23,17 @@ public function getAssets(): array
];
}

public function attachmentRoute(string $route): self
public function attachmentEndpoint(string $value): self
{
$this->attachmentRoute = $route;
$this->attachmentEndpoint = $value;

return $this;
}

protected function viewData(): array
{
return [
'attachmentRoute' => $this->attachmentRoute
'attachmentEndpoint' => $this->attachmentEndpoint
];
}
}

0 comments on commit c97e48a

Please sign in to comment.