File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -75,12 +75,6 @@ public static function form(Form $form): Form
75
75
Forms \Components \Toggle::make ('notifications ' )
76
76
->label (__ ('Send notifications to subscribers. ' ))
77
77
->required (),
78
- Forms \Components \TextInput::make ('guid ' )
79
- ->required ()
80
- ->default (fn () => (string ) Str::uuid ())
81
- ->unique (ignoreRecord: true )
82
- ->maxLength (36 )
83
- ->hidden (),
84
78
]),
85
79
]);
86
80
}
Original file line number Diff line number Diff line change @@ -48,6 +48,15 @@ class Incident extends Model
48
48
'occurred_at ' ,
49
49
];
50
50
51
+ protected static function boot ()
52
+ {
53
+ parent ::boot ();
54
+
55
+ self ::creating (function (Incident $ model ) {
56
+ $ model ->guid = Str::uuid ();
57
+ });
58
+ }
59
+
51
60
/**
52
61
* Get the components impacted by this incident.
53
62
*/
Original file line number Diff line number Diff line change 9
9
expect ($ incident ->components )->toHaveCount (2 );
10
10
});
11
11
12
+ it ('will set default guid ' , function () {
13
+ $ incident = Incident::factory ()->state (['guid ' => null ])->create ();
14
+
15
+ expect ($ incident )->guid ->not ()->toBeNull ();
16
+ });
17
+
12
18
it ('can scope to a specific status ' , function () {
13
19
Incident::factory ()->sequence (
14
20
['status ' => IncidentStatusEnum::investigating],
You can’t perform that action at this time.
0 commit comments