From 06e17c8386fdee94acaf58d1c5d4431523b3e810 Mon Sep 17 00:00:00 2001 From: aaron Date: Fri, 16 Feb 2024 10:55:16 -0600 Subject: [PATCH] refactor: disable file uploads for presentation content fields See https://github.com/alkrauss48/simple-slides/issues/1 --- app/Filament/Resources/PresentationResource.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Filament/Resources/PresentationResource.php b/app/Filament/Resources/PresentationResource.php index 2d438a0..f865c0d 100644 --- a/app/Filament/Resources/PresentationResource.php +++ b/app/Filament/Resources/PresentationResource.php @@ -46,7 +46,16 @@ public static function form(Form $form): Form .'You can toggle your theme in the top right menu.' ))->columnSpan([ 'md' => 2, - ]), + ])->disableToolbarButtons([ + 'attachFiles', + ])->saveUploadedFileAttachmentsUsing(function () { + // Block images from being uploaded. + // This prevents drag-and-drop uploads. + return null; + })->getUploadedAttachmentUrlUsing(function () { + // Required to go along with a null `saveUploadedFileAttachmentsUsing` + return null; + }), Section::make('Details') ->description('All the metadata related to your presentation.') ->columnSpan(1)