From 7ad8b1e0906eda2495b5ce75ac64d30afc7a0635 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 25 Nov 2026 11:36:13 +0530 Subject: [PATCH 1/4] Added shared clip board migration file --- ...111654_create_shared_clip_boards_table.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 database/migrations/2026_11_25_111654_create_shared_clip_boards_table.php diff --git a/database/migrations/2026_11_25_111654_create_shared_clip_boards_table.php b/database/migrations/2026_11_25_111654_create_shared_clip_boards_table.php new file mode 100644 index 00000000..392be72b --- /dev/null +++ b/database/migrations/2026_11_25_111654_create_shared_clip_boards_table.php @@ -0,0 +1,28 @@ +id(); + $table->longText('content')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('shared_clip_boards'); + } +}; From 397fe66bb6cada42c1ea7bcd8047fcd4116228ae Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 25 Nov 2026 11:37:36 +0530 Subject: [PATCH 2/4] Added shared clip board model file --- app/Models/SharedClipBoard.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/Models/SharedClipBoard.php diff --git a/app/Models/SharedClipBoard.php b/app/Models/SharedClipBoard.php new file mode 100644 index 00000000..efa6663f --- /dev/null +++ b/app/Models/SharedClipBoard.php @@ -0,0 +1,15 @@ + Date: Wed, 25 Nov 2026 11:41:20 +0530 Subject: [PATCH 3/4] Added shared editor page --- app/Filament/Pages/SharedEditor.php | 75 +++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 app/Filament/Pages/SharedEditor.php diff --git a/app/Filament/Pages/SharedEditor.php b/app/Filament/Pages/SharedEditor.php new file mode 100644 index 00000000..58210c50 --- /dev/null +++ b/app/Filament/Pages/SharedEditor.php @@ -0,0 +1,75 @@ + 1], + ['content' => ''] + ); + + $this->content = $clipboard->content ?? ''; + + $this->lastSyncedContent = $this->content; + } + + public function updatedContent(): void + { + SharedClipBoard::where('id', 1)->update([ + 'content' => $this->content, + ]); + + $this->lastSyncedContent = $this->content; + } + + public function refreshSharedContent(): void + { + $sharedContent = SharedClipBoard::find(1)?->content ?? ''; + + // Do not overwrite text that this user is editing. + if ( + $this->content === $this->lastSyncedContent + && $sharedContent !== $this->lastSyncedContent + ) { + $this->content = $sharedContent; + + $this->lastSyncedContent = $sharedContent; + } + } + + public function clearContent(): void + { + SharedClipBoard::where('id', 1)->update([ + 'content' => '', + ]); + + $this->content = ''; + + $this->lastSyncedContent = ''; + } + + public static function canAccess(): bool + { + return Auth::check() && Auth::user()->can('view shared clipboard page'); + } + +} From c969253e33e25fca775be246dd723ffff5a2c79e Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 25 Nov 2026 11:44:21 +0530 Subject: [PATCH 4/4] Added permission for shared clipboard page --- database/seeders/PermissionSeeder.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/database/seeders/PermissionSeeder.php b/database/seeders/PermissionSeeder.php index 059cbfe3..611818b6 100644 --- a/database/seeders/PermissionSeeder.php +++ b/database/seeders/PermissionSeeder.php @@ -292,5 +292,7 @@ class PermissionSeeder extends Seeder Permission::updateOrCreate(['name' => 'view test certificate page']); Permission::updateOrCreate(['name' => 'view process order rejection dashboard']); + Permission::updateOrCreate(['name' => 'view shared clipboard page']); + } }