Conditions | 3 |
Paths | 4 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function transform(Log $log): array |
||
20 | { |
||
21 | $subject = $log->subject_type; |
||
22 | $subjects = str_plural($subject); |
||
|
|||
23 | $route = Route::has("adminarea.{$subjects}.edit") ? route("adminarea.{$subjects}.edit", [$subject => $log->subject]) : null; |
||
24 | |||
25 | if ($log->subject) { |
||
26 | $subjectName = ucfirst($subject).': '.($log->subject->username ?? $log->subject->name ?? $log->subject->name); |
||
27 | } else { |
||
28 | $subjectName = ucfirst($subject).': Not Found!'; |
||
29 | } |
||
30 | |||
31 | return $this->escape([ |
||
32 | 'id' => (int) $log->getKey(), |
||
33 | 'description' => (string) $log->description, |
||
34 | 'subject' => $subjectName, |
||
35 | 'subject_route' => $route, |
||
36 | 'properties' => (object) $log->properties, |
||
37 | 'created_at' => (string) $log->created_at, |
||
38 | ]); |
||
39 | } |
||
40 | } |
||
41 |
This function has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.