Skip to content

Commit

Permalink
Make category nullable, fixes #230
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed May 2, 2022
1 parent 7f736ac commit 2c66a7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Models/MarkdownPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}

0 comments on commit 2c66a7d

Please sign in to comment.