File tree Expand file tree Collapse file tree 5 files changed +36
-4
lines changed Expand file tree Collapse file tree 5 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 17
17
],
18
18
"require" : {
19
19
"php" : " ^8.0" ,
20
- "filament/filament" : " ^2.9 " ,
21
- "filament/forms" : " ^2.9 " ,
20
+ "filament/filament" : " ^2.10 " ,
21
+ "filament/forms" : " ^2.10 " ,
22
22
"illuminate/contracts" : " ^8.73" ,
23
23
"spatie/laravel-package-tools" : " ^1.9.2"
24
24
},
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ public static function make(): Placeholder
10
10
{
11
11
return Placeholder::make ('created_at ' )
12
12
->label (tr ('time.created_at ' ))
13
- ->content (fn ($ record ): string => $ record ->created_at ? $ record ->created_at ->diffForHumans () : '- ' );
13
+ ->content (fn ($ record ): string => $ record? ->created_at ? $ record ->created_at ->diffForHumans () : '- ' );
14
14
}
15
15
}
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ public static function make(): Placeholder
10
10
{
11
11
return Placeholder::make ('updated_at ' )
12
12
->label (tr ('time.updated_at ' ))
13
- ->content (fn ($ record ): string => $ record ->updated_at ? $ record ->updated_at ->diffForHumans () : '- ' );
13
+ ->content (fn ($ record ): string => $ record? ->updated_at ? $ record ->updated_at ->diffForHumans () : '- ' );
14
14
}
15
15
}
Original file line number Diff line number Diff line change 8
8
9
9
use function Spatie \PestPluginTestTime \testTime ;
10
10
11
+ it ('can return a dash if the record is null ' , function () {
12
+ TestableForm::$ formSchema = [
13
+ CreatedAt::make (),
14
+ ];
15
+
16
+ testTime ()->freeze ();
17
+
18
+ $ component = Livewire::test (TestableForm::class, [
19
+ 'record ' => null ,
20
+ ]);
21
+
22
+ $ component
23
+ ->assertSet ('record.created_at ' , null )
24
+ ->assertSee ('- ' );
25
+ });
26
+
11
27
it ('can return a dash if the created at time is null ' , function () {
12
28
TestableForm::$ formSchema = [
13
29
CreatedAt::make (),
Original file line number Diff line number Diff line change 8
8
9
9
use function Spatie \PestPluginTestTime \testTime ;
10
10
11
+ it ('can return a dash if the record is null ' , function () {
12
+ TestableForm::$ formSchema = [
13
+ UpdatedAt::make (),
14
+ ];
15
+
16
+ testTime ()->freeze ();
17
+
18
+ $ component = Livewire::test (TestableForm::class, [
19
+ 'record ' => null ,
20
+ ]);
21
+
22
+ $ component
23
+ ->assertSet ('record.updated_at ' , null )
24
+ ->assertSee ('- ' );
25
+ });
26
+
11
27
it ('can return a dash if the updated at time is null ' , function () {
12
28
TestableForm::$ formSchema = [
13
29
UpdatedAt::make (),
You can’t perform that action at this time.
0 commit comments