* * 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, ]; } }