123456789101112131415161718192021222324252627282930 |
- <?php
- /*
- * This file is part of the Jiannei/lumen-api-starter.
- *
- * (c) Jiannei <longjian.huang@foxmail.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- namespace App\Http\Resources\CMS;
- use App\Repositories\Enums\Base\BannerClickTypeEnum;
- use Illuminate\Http\Resources\Json\JsonResource;
- class BannerResource extends JsonResource
- {
- public function toArray($request)
- {
- return [
- 'id' => $this->id,
- 'name' => $this->name,
- 'click_type' => $this->click_type,
- 'click_type_text' => BannerClickTypeEnum::getDescription($this->click_type),
- 'click_body' => $this->click_body,
- 'cover_resource' => $this->cover_resource,
- ];
- }
- }
|