SystemOperationLogResource.php 707 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Http\Resources\API;
  3. use Illuminate\Http\Request;
  4. class SystemOperationLogResource extends BaseResource
  5. {
  6. /**
  7. * Transform the resource into an array.
  8. *
  9. * @return array<string, mixed>
  10. */
  11. public function toArray(Request $request): array
  12. {
  13. return [
  14. 'id' => $this->id,
  15. 'ip' => $this->ip,
  16. 'user' => new UserProfileResource($this->user),
  17. 'url' => $this->url,
  18. 'method' => $this->method,
  19. 'browser' => $this->browser,
  20. 'platform' => $this->platform,
  21. 'request_at' => (string)$this->request_at,
  22. 'display_id' => $this->display_id,
  23. ];
  24. }
  25. }