SearchTitleIndexResource.php 555 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Resources;
  3. use Illuminate\Contracts\Support\Arrayable;
  4. use Illuminate\Http\Request;
  5. use Illuminate\Http\Resources\Json\JsonResource;
  6. class SearchTitleIndexResource extends JsonResource
  7. {
  8. /**
  9. * Transform the resource into an array.
  10. *
  11. * @param Request $request
  12. * @return array|Arrayable|\JsonSerializable
  13. */
  14. public function toArray($request)
  15. {
  16. $data = [
  17. 'word' => $this->text,
  18. 'count' => 0,
  19. 'bold' => 0,
  20. ];
  21. return $data;
  22. }
  23. }