12345678910111213141516171819202122232425 |
- <?php
- namespace App\Http\Resources;
- use Illuminate\Http\Resources\Json\JsonResource;
- class GroupSendSmsResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @param \Illuminate\Http\Request $request
- * @return array
- */
- public function toArray($request)
- {
- $model = $this->resource;
- $data = [
- 'area_name' => $model->areas->name ?? '',
- 'arr_ids' => empty($model->ids)? [] : json_decode($model->ids)
- ];
- return array_merge(parent::toArray($request),$data);
- }
- }
|