From 2c66a7d2eb35016a37bdfe50d41781ef9e893806 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 2 May 2022 16:44:26 +0200 Subject: [PATCH] Make category nullable, fixes #230 --- src/Models/MarkdownPost.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Models/MarkdownPost.php b/src/Models/MarkdownPost.php index 443216d1..df753231 100644 --- a/src/Models/MarkdownPost.php +++ b/src/Models/MarkdownPost.php @@ -15,7 +15,7 @@ class MarkdownPost extends MarkdownDocument use HasDateString; use HasFeaturedImage; - public string $category; + public ?string $category; public static string $sourceDirectory = '_posts'; public static string $parserClass = MarkdownPostParser::class; @@ -29,6 +29,6 @@ public function __construct(array $matter, string $body, string $title = '', str $this->constructDateString(); $this->constructFeaturedImage(); - $this->category = $this->matter['category'] ?? ''; + $this->category = $this->matter['category'] ?? null; } }