123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace App\Repositories\Transformers\Lab;
- use App\Repositories\Transformers\BaseTransformer;
- use Carbon\Carbon;
- /**
- * Class MaintainTransformer.
- *
- * @package namespace App\Repositories\Transformers\Lab;
- */
- class MaintainTransformer extends BaseTransformer
- {
- /**
- * Transform the Maintain entity.
- *
- * @param \App\Repositories\Models\Lab\Maintain $model
- *
- * @return array
- */
- public function lists($model)
- {
- return [
- 'id' => (int)$model->id,
- 'day' => $model->day,
- 'week' => $model->week,
- 'time' => $model->time,
- 'week_index' => $model->week_index,
- 'room' => $model->room,
- 'maintain_admin' => $model->maintain_admin,
- 'admin' => $model->admin,
- // 'body' => $model->body,
- 'status' => $model->status,
- 'created_at' => $model->created_at->format(Carbon::DEFAULT_TO_STRING_FORMAT),
- 'updated_at' => $model->updated_at->format(Carbon::DEFAULT_TO_STRING_FORMAT)
- ];
- }
- public function detail($model)
- {
- return [
- 'id' => (int)$model->id,
- 'day' => $model->day,
- 'week' => $model->week,
- 'time' => $model->time,
- 'week_index' => $model->week_index,
- 'maintain_admin' => $model->maintain_admin,
- 'room' => $model->room,
- 'admin' => $model->admin,
- 'body' => $model->body,
- 'status' => $model->status,
- 'created_at' => $model->created_at->format(Carbon::DEFAULT_TO_STRING_FORMAT),
- 'updated_at' => $model->updated_at->format(Carbon::DEFAULT_TO_STRING_FORMAT)
- ];
- }
- }
|