File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class Workflow extends Model
20
20
21
21
protected $ table = 'workflows ' ;
22
22
23
- protected $ guarded= ['id ' ];
23
+ protected $ guarded = ['id ' ];
24
24
25
25
/**
26
26
* @return HasMany<WorkflowTransition>
@@ -50,14 +50,14 @@ public function allStatuses(): \Illuminate\Support\Collection
50
50
{
51
51
$ statuses = collect ();
52
52
$ this ->transitions
53
- ->each (fn (WorkflowTransition $ transition ) => $ statuses
53
+ ->each (fn (WorkflowTransition $ transition ) => $ statuses
54
54
->add ($ transition ->fromStatus )
55
55
->add ($ transition ->toStatus )
56
56
);
57
57
58
58
return $ statuses ->filter ()->unique ('id ' );
59
59
}
60
-
60
+
61
61
public static function findWithName (string $ name ): ?Workflow
62
62
{
63
63
return self ::where ('name ' , $ name )->first ();
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ class WorkflowTransition extends Model
30
30
use BelongsToWorkflow;
31
31
32
32
use HasPermissions;
33
-
34
33
use SoftDeletes;
35
34
36
35
public string $ guard_name = 'web ' ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public static function bootHasWorkflows(): void
43
43
public function initWorkflow (int |Workflow $ workflow ): static
44
44
{
45
45
$ this ->with = array_unique (array_merge ($ this ->with , ['modelStatus ' ]));
46
-
46
+
47
47
$ this ->usingWorkflow ($ workflow );
48
48
if ($ this ->modelStatus === null ) {
49
49
$ this ->createModelStatus ($ workflow , TransitionService::getWorkflowStartStatus ($ workflow ));
@@ -129,7 +129,7 @@ public function isInStatus(string|BackedEnum $statusName): bool
129
129
public function scopeInStatus (
130
130
Builder $ query ,
131
131
int |array |BackedEnum |WorkflowStatus |Collection $ status ,
132
- null | int |string |Workflow $ workflow = null ,
132
+ int |string |Workflow $ workflow = null ,
133
133
): Builder {
134
134
$ workflow = is_string ($ workflow )
135
135
? Workflow::findWithName ($ workflow )
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- use Illuminate \Support \Facades \Schema ;
4
- use Illuminate \Database \Schema \Blueprint ;
5
3
use Illuminate \Database \Migrations \Migration ;
4
+ use Illuminate \Database \Schema \Blueprint ;
5
+ use Illuminate \Support \Facades \Schema ;
6
6
use Spatie \Permission \PermissionRegistrar ;
7
7
8
8
class CreatePermissionTables extends Migration
You can’t perform that action at this time.
0 commit comments