add reason in corporate, plan, service
This commit is contained in:
30
Modules/Internal/Transformers/AuditTrailResource.php
Normal file
30
Modules/Internal/Transformers/AuditTrailResource.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Internal\Transformers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class AuditTrailResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$audit_trail = [
|
||||
'id' => $this->id,
|
||||
'old_values' => json_decode($this->old_values),
|
||||
'new_values' => json_decode($this->new_values),
|
||||
'action' => $this->action,
|
||||
'user_id' => $this->user->email,
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
|
||||
return $audit_trail;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user