/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
tests/Integration/Http/Fixtures/PostResourceWithJsonOptions.php
22 строки
459 B
bastien-phi
[8.x] Add ability to customize json options on JsonResource response (#40208)
03 янв 2022, 18:55
Не верифицирован
03 янв 2022, 18:55
53a9850
Код
Авторство
О чём код?
<?php namespace Illuminate\Tests\Integration\Http\Fixtures; use Illuminate\Http\Resources\Json\JsonResource; class PostResourceWithJsonOptions extends JsonResource { public function toArray($request) { return [ 'id' => $this->id, 'title' => $this->title, 'reading_time' => $this->reading_time, ]; } public function jsonOptions() { return JSON_PRESERVE_ZERO_FRACTION; } }