add reason in corporate, plan, service

This commit is contained in:
2023-06-05 09:01:43 +07:00
parent 4fb2bab64e
commit 4cc2ae24b8
34 changed files with 2037 additions and 87 deletions

View 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;
}
}