File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ public static function form(Schema $schema): Schema
4040 ->required ()
4141 ->maxLength (255 )
4242 ->live (onBlur: true )
43- ->afterStateUpdated (function (Article $ article , Set $ set , ?string $ state ): void {
44- if ($ article ->isPublished ()) {
43+ ->afterStateUpdated (function (? Article $ article , Set $ set , ?string $ state ): void {
44+ if ($ article? ->isPublished()) {
4545 return ;
4646 }
4747
@@ -53,11 +53,11 @@ public static function form(Schema $schema): Schema
5353 ->maxLength (255 )
5454 ->live (onBlur: true )
5555 ->unique (Article::class, 'slug ' , ignoreRecord: true )
56- ->disabled (fn (Article $ article ) => $ article ->isPublished ())
56+ ->disabled (fn (? Article $ article ) => $ article? ->isPublished() ?? false )
5757 ->afterStateUpdated (
5858 fn (Set $ set , ?string $ state ) => $ set ('slug ' , Str::slug ($ state ))
5959 )
60- ->helperText (fn (Article $ article ) => $ article ->isPublished ()
60+ ->helperText (fn (? Article $ article ) => $ article? ->isPublished()
6161 ? 'The slug cannot be changed after the article is published. '
6262 : false
6363 ),
You can’t perform that action at this time.
0 commit comments