File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11
11
use Illuminate \Foundation \Auth \User ;
12
12
use Squarebit \Workflows \Contracts \Workflowable ;
13
13
use Squarebit \Workflows \Traits \BelongsToWorkflow ;
14
+ use function Pest \Laravel \instance ;
14
15
15
16
/**
16
17
* @property Model $model
@@ -58,11 +59,11 @@ public function status(): BelongsTo
58
59
59
60
public function scopeInStatus (Builder $ query , int |WorkflowStatus $ status ): Builder
60
61
{
61
- return $ query ->where ('workflow_status_id ' , $ status );
62
+ return $ query ->where ('workflow_status_id ' , $ status instanceof WorkflowStatus ? $ status -> getKey () : $ status );
62
63
}
63
64
64
65
public function scopeForWorkflow (Builder $ query , int |Workflow $ workflow ): Builder
65
66
{
66
- return $ query ->where ('workflow_id ' , $ workflow );
67
+ return $ query ->where ('workflow_id ' , $ workflow instanceof Workflow ? $ workflow -> getKey () : $ workflow );
67
68
}
68
69
}
You can’t perform that action at this time.
0 commit comments