disk->exists($this->filename); } /** * Load markdown file */ public function load() { $content = $this->disk->get($this->filename); $this->set($content); } /** * Return current markdown content */ public function get(): ?string { return $this->content; } /** * Set current markdown content */ public function set(?string $content = null): void { $this->content = $content; } /** * Return a boolean value indicating if the file has changed since it was * loaded */ public function isDirty(): bool { return $this->originalContent !== $this->content; } /** * Store file on disk */ public function save(): bool { if (!$this->isDirty()) { return false; } $this->disk->put($this->filename, $this->content); $this->originalContent = $this->content; return true; } }