Skip to content

Commit a217f43

Browse files
committed
Fixes
1 parent 00d9b68 commit a217f43

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Models/WorkflowTransition.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Database\Eloquent\Relations\BelongsTo;
88
use Illuminate\Database\Eloquent\SoftDeletes;
99
use Spatie\Permission\Traits\HasPermissions;
10+
use Spatie\Permission\Traits\HasRoles;
1011
use Squarebit\Workflows\Traits\BelongsToWorkflow;
1112

1213
/**
@@ -29,7 +30,7 @@ class WorkflowTransition extends Model
2930
/** @use BelongsToWorkflow<WorkflowTransition> */
3031
use BelongsToWorkflow;
3132

32-
use HasPermissions;
33+
use HasRoles;
3334
use SoftDeletes;
3435

3536
public string $guard_name = 'web';

src/Traits/HasWorkflows.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function initWorkflow(int|Workflow $workflow): static
5757
{
5858
$isInitialized = WorkflowModelStatus::query()
5959
->where('workflow_id', is_int($workflow) ? $workflow : $workflow->getKey())
60-
->where('model', $this)
60+
->whereMorphedTo('model', $this)
6161
->count();
6262

6363
if (! $isInitialized) {

0 commit comments

Comments
 (0)