1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Repositories\Transformers\Lab;
- use Carbon\Carbon;
- use League\Fractal\TransformerAbstract;
- use App\Repositories\Models\Lab\AccountApply;
- /**
- * Class AccountApplyTransformer.
- *
- * @package namespace App\Repositories\Transformers\Lab;
- */
- class AccountApplyTransformer extends TransformerAbstract
- {
- /**
- * Transform the AccountApply entity.
- *
- * @param \App\Repositories\Models\Lab\AccountApply $model
- *
- * @return array
- */
- public function transform(AccountApply $model)
- {
- return [
- 'id' => (int)$model->id,
- 'account' => $model->account,
- 'name' => $model->name,
- 'mobile' => $model->mobile,
- 'department' => $model->department,
- 'check_status' => $model->check_status,
- 'check_admin' => $model->check_admin,
- 'check_time' => $model->check_time,
- 'check_result' => $model->check_result,
- 'roles' => $model->roles,
- '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)
- ];
- }
- }
|