123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Repositories\Transformers\Finance;
- use Carbon\Carbon;
- use League\Fractal\TransformerAbstract;
- use App\Repositories\Models\Finance\Shop;
- /**
- * Class ShopTransformer.
- *
- * @package namespace App\Repositories\Transformers\Finance;
- */
- class ShopTransformer extends TransformerAbstract
- {
- /**
- * Transform the Shop entity.
- *
- * @param \App\Repositories\Models\Finance\Shop $model
- *
- * @return array
- */
- public function transform(Shop $model)
- {
- return [
- 'id' => (int)$model->id,
- /* place your other model properties here */
- 'name' => $model->name,
- 'platform' => $model->platform,
- 'platform_text' => $model->platform_text,
- 'koudian' => $model->koudian,
- '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)
- ];
- }
- }
|