NissayaEndingResource.php 806 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Http\Resources;
  3. use Illuminate\Http\Resources\Json\JsonResource;
  4. use App\Http\Api\UserApi;
  5. class NissayaEndingResource extends JsonResource
  6. {
  7. /**
  8. * Transform the resource into an array.
  9. *
  10. * @param \Illuminate\Http\Request $request
  11. * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
  12. */
  13. public function toArray($request)
  14. {
  15. return [
  16. "id"=>$this->id,
  17. "ending"=> $this->ending,
  18. "lang"=> $this->lang,
  19. "relation"=> $this->relation,
  20. "case"=> $this->case,
  21. "count"=> $this->count,
  22. "editor"=> UserApi::getById($this->editor_id),
  23. "created_at"=> $this->created_at,
  24. "updated_at"=> $this->updated_at,
  25. ];
  26. }
  27. }