AccountApplyTransformer.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Repositories\Transformers\Lab;
  3. use Carbon\Carbon;
  4. use League\Fractal\TransformerAbstract;
  5. use App\Repositories\Models\Lab\AccountApply;
  6. /**
  7. * Class AccountApplyTransformer.
  8. *
  9. * @package namespace App\Repositories\Transformers\Lab;
  10. */
  11. class AccountApplyTransformer extends TransformerAbstract
  12. {
  13. /**
  14. * Transform the AccountApply entity.
  15. *
  16. * @param \App\Repositories\Models\Lab\AccountApply $model
  17. *
  18. * @return array
  19. */
  20. public function transform(AccountApply $model)
  21. {
  22. return [
  23. 'id' => (int)$model->id,
  24. 'account' => $model->account,
  25. 'name' => $model->name,
  26. 'mobile' => $model->mobile,
  27. 'department' => $model->department,
  28. 'check_status' => $model->check_status,
  29. 'check_admin' => $model->check_admin,
  30. 'check_time' => $model->check_time,
  31. 'check_result' => $model->check_result,
  32. 'roles' => $model->roles,
  33. 'status' => $model->status,
  34. 'created_at' => $model->created_at->format(Carbon::DEFAULT_TO_STRING_FORMAT),
  35. 'updated_at' => $model->updated_at->format(Carbon::DEFAULT_TO_STRING_FORMAT)
  36. ];
  37. }
  38. }