File tree Expand file tree Collapse file tree 2 files changed +9
-20
lines changed Expand file tree Collapse file tree 2 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -259,8 +259,12 @@ protected function formatActivityData($activity): array
259
259
];
260
260
}
261
261
262
- private static function formatDateValues (array |string $ value ): array |string
262
+ private static function formatDateValues (array |string | null $ value ): array |string | null
263
263
{
264
+ if (is_null ($ value )) {
265
+ return $ value ;
266
+ }
267
+
264
268
if (is_array ($ value )) {
265
269
foreach ($ value as &$ item ) {
266
270
$ item = self ::formatDateValues ($ item );
@@ -276,4 +280,5 @@ private static function formatDateValues(array|string $value): array|string
276
280
return $ value ;
277
281
}
278
282
}
283
+
279
284
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace Rmsramos \Activitylog \Resources ;
4
4
5
- use Carbon \Exceptions \InvalidFormatException ;
6
5
use Filament \Facades \Filament ;
7
6
use Filament \Forms \Components \DatePicker ;
8
7
use Filament \Forms \Components \KeyValue ;
26
25
use Illuminate \Support \HtmlString ;
27
26
use Illuminate \Support \Str ;
28
27
use Livewire \Component as Livewire ;
28
+ use Rmsramos \Activitylog \Actions \Concerns \ActionContent ;
29
29
use Rmsramos \Activitylog \ActivitylogPlugin ;
30
30
use Rmsramos \Activitylog \RelationManagers \ActivitylogRelationManager ;
31
31
use Rmsramos \Activitylog \Resources \ActivitylogResource \Pages \ListActivitylog ;
34
34
35
35
class ActivitylogResource extends Resource
36
36
{
37
+ use ActionContent;
38
+
37
39
public static function getModel (): string
38
40
{
39
41
return Activity::class;
@@ -313,22 +315,4 @@ public static function canAccess(): bool
313
315
return ActivitylogPlugin::get ()->isAuthorized ();
314
316
}
315
317
}
316
-
317
- private static function formatDateValues (array |string $ value ): array |string
318
- {
319
- if (is_array ($ value )) {
320
- foreach ($ value as &$ item ) {
321
- $ item = self ::formatDateValues ($ item );
322
- }
323
-
324
- return $ value ;
325
- }
326
-
327
- try {
328
- return Carbon::parse ($ value )
329
- ->format (config ('filament-activitylog.datetime_format ' , 'd/m/Y H:i:s ' ));
330
- } catch (InvalidFormatException $ e ) {
331
- return $ value ;
332
- }
333
- }
334
318
}
You can’t perform that action at this time.
0 commit comments