ReviewResource.php 529 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Http\Resources;
  3. use Illuminate\Http\Resources\Json\JsonResource;
  4. class ReviewResource extends JsonResource
  5. {
  6. /**
  7. * Transform the resource into an array.
  8. *
  9. * @param \Illuminate\Http\Request $request
  10. * @return array
  11. */
  12. public function toArray($request)
  13. {
  14. return [
  15. 'id' => $this->id,
  16. 'game_id' => $this->game_id,
  17. 'author_id' => $this->author_id,
  18. 'text' => $this->text,
  19. 'stars' => $this->stars
  20. ];
  21. }
  22. }