I have yaml frontmatter installed in a php/Laravel project, but I cannot get it to work as documentend.
I made a testfile test.html:
---
title: Example
---
Lorem ipsum.
Then I try to parse with yaml:
$document = YamlFrontMatter::parse(file_get_contents('test.html'));
dd($document->title);
The result:
Spatie\YamlFrontMatter\Document {#280 ▼
#matter: []
#body: "--- title: Example --- Lorem ipsum."
}
While matter should be:
['title' => 'Example']
What am I doing wrong?
Kind regards
Hubert