diff --git a/app/Filament/Pages/SharedEditor.php b/app/Filament/Pages/SharedEditor.php index 35afcbb3..8819fb7e 100644 --- a/app/Filament/Pages/SharedEditor.php +++ b/app/Filament/Pages/SharedEditor.php @@ -57,15 +57,9 @@ class SharedEditor extends Page } } - public function clearContent(): void + public function copyContent(): void { - SharedClipBoard::where('id', 1)->update([ - 'content' => '', - ]); - - $this->content = ''; - - $this->lastSyncedContent = ''; + $this->dispatch('copy-to-clipboard', content: $this->content); } public static function canAccess(): bool diff --git a/resources/views/filament/pages/shared-editor.blade.php b/resources/views/filament/pages/shared-editor.blade.php index 5a76ab09..4e14f31c 100644 --- a/resources/views/filament/pages/shared-editor.blade.php +++ b/resources/views/filament/pages/shared-editor.blade.php @@ -58,12 +58,11 @@ {{-- Clear Button --}} - Clear Content + Copy To ClipBoard @@ -99,4 +98,43 @@ +@script + +@endscript +