From ba9e3ffffe7c21bd32ed0f2995a873b51f28c35a Mon Sep 17 00:00:00 2001 From: Massimo Triassi Date: Mon, 5 May 2025 12:36:39 -0400 Subject: [PATCH 1/2] fix: #16 add missing null-safe operator to clear cache call --- src/Models/Content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Content.php b/src/Models/Content.php index 0375bd5..081b656 100644 --- a/src/Models/Content.php +++ b/src/Models/Content.php @@ -21,7 +21,7 @@ class Content extends Model implements ContentInterface protected static function boot() { static::saved(function (ContentInterface $content) { - $content->contentable->clearCache(); + $content->contentable?->clearCache(); }); parent::boot(); From 5233245d6b952fc2a7f592d9ca75487102a35d0c Mon Sep 17 00:00:00 2001 From: m-triassi <9440691+m-triassi@users.noreply.github.com> Date: Mon, 5 May 2025 16:36:59 +0000 Subject: [PATCH 2/2] Fix styling --- src/Concerns/HasLayouts.php | 2 +- src/Exceptions/ContentableException.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Concerns/HasLayouts.php b/src/Concerns/HasLayouts.php index 03d340e..180f1cf 100644 --- a/src/Concerns/HasLayouts.php +++ b/src/Concerns/HasLayouts.php @@ -61,7 +61,7 @@ public static function indexLayout(): Layout public static function layouts(): Collection { if (! static::customizeableLayout()) { - return new Collection(); + return new Collection; } $layoutModel = static::layoutModel(); diff --git a/src/Exceptions/ContentableException.php b/src/Exceptions/ContentableException.php index 53e7ac5..a7a9711 100644 --- a/src/Exceptions/ContentableException.php +++ b/src/Exceptions/ContentableException.php @@ -4,6 +4,4 @@ use Exception; -class ContentableException extends Exception -{ -} +class ContentableException extends Exception {}