From 001fbc14abaaa4b4c438c442dc9c8530ae4f236f Mon Sep 17 00:00:00 2001 From: mostafaznv Date: Fri, 29 Sep 2023 14:23:56 +0330 Subject: [PATCH] feat(audio-picker): set default values for config properties to make this feature backward compatible --- src/AudioStorage.php | 2 +- src/CkEditor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AudioStorage.php b/src/AudioStorage.php index 67ccd1b..3feb91a 100644 --- a/src/AudioStorage.php +++ b/src/AudioStorage.php @@ -11,7 +11,7 @@ public function __construct(string $disk = 'audio') { parent::__construct($disk); - $this->namingMethod = config('nova-ckeditor.audio-naming-method'); + $this->namingMethod = config('nova-ckeditor.audio-naming-method') ?? 'hash-file'; } public static function make(string $disk = 'audio'): self diff --git a/src/CkEditor.php b/src/CkEditor.php index b9cb708..a635270 100755 --- a/src/CkEditor.php +++ b/src/CkEditor.php @@ -353,7 +353,7 @@ private function prepareToolbar(string $toolbar, array $items = null): void $this->height = $toolbar['height']; $this->imageBrowser = $toolbar['browser']['image']; $this->videoBrowser = $toolbar['browser']['video']; - $this->audioBrowser = $toolbar['browser']['audio']; + $this->audioBrowser = $toolbar['browser']['audio'] ?? true; $this->snippetBrowser = $this->prepareSnippets($toolbar['snippets']); $this->contentLanguage = $toolbar['content-lang']; $this->textPartLanguage = $toolbar['text-part-language'] ?? $defaultTextPartLanguage;