1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Repositories\Transformers\Base;
- use App\Repositories\Models\Base\Shop;
- use Carbon\Carbon;
- use League\Fractal\TransformerAbstract;
- /**
- * Class ShopTransformer.
- *
- * @package namespace App\Repositories\Transformers\Base;
- */
- class ShopTransformer extends TransformerAbstract
- {
- /**
- * Transform the Role entity.
- *
- * @param \App\Repositories\Models\Base\Shop $model
- *
- * @return array
- */
- public function transform(Shop $model)
- {
- return [
- 'id' => (int)$model->id,
- 'name' => $model->name,
- 'show_title' => $model->show_title,
- 'sign' => $model->sign,
- 'end_time' => $model->end_time,
- 'point' => $model->point,
- '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)
- ];
- }
- }
|