SearchTitleIndexResource.php 525 B

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