Skip to content

Commit

Permalink
wip [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangjchandler committed Mar 21, 2021
1 parent 8412149 commit be3ada9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Drivers/Markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public function save(Model $model, string $directory): bool
{
$key = $model->getKey();

if ($model->wasChanged($model->getKeyName())) {
unlink($directory . DIRECTORY_SEPARATOR . $model->getOriginal($model->getKeyName()) . '.md');
}

if (! file_exists($path = $directory . DIRECTORY_SEPARATOR . $key . '.md')) {
touch($path);
}
Expand Down

0 comments on commit be3ada9

Please sign in to comment.