12345678910111213141516171819202122232425262728 |
- <?php
- namespace App\Http\Resources\App;
- use Illuminate\Http\Resources\Json\JsonResource;
- class BikeOnlineResource extends JsonResource
- {
- /**
- * Transform the resource into an array.
- *
- * @param \Illuminate\Http\Request $request
- * @return array
- */
- public function toArray($request)
- {
- $model = $this->resource;
- $data = [
- 'reason' => $model->reason,
- 'name' => $model->name,
- 'created_at' => date("Y-m-d H:i:s", strtotime($model->created_at)),
- 'username' => $model->workers->name,
- 'mobile' => $model->workers->phone
- ];
- return $data;
- }
- }
|