Skip to content

Commit

Permalink
feat: renew the flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nikuscs committed Jul 13, 2024
1 parent 838993e commit 9917365
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Models/Flow.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,15 @@ public function flowable(): MorphTo
{
return $this->morphTo();
}

/**
* Renews the flow
* @return void
*/
public function renew(): void
{
$flowable = $this->flowable;
$this->delete();
$flowable->flows()->create();

Check failure on line 56 in src/Models/Flow.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Illuminate\Database\Eloquent\Model::flows().
}
}

0 comments on commit 9917365

Please sign in to comment.