%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/diaspora/api/app/Transformers/App/
Upload File :
Create Path :
Current File : /var/www/html/diaspora/api/app/Transformers/App/SectionDetailTransformer.php

<?php

namespace App\Transformers\App;

use App\Models\Section;
use App\Transformers\BaseTransformer;

class SectionDetailTransformer extends BaseTransformer
{
    /**
     * @param Section $section
     *
     * @return array
     */
    public function transform(Section $section)
    {
        return [
            'id'             => $section->id,
            'title'          => $section->title,
            'order'          => $section->order,
            'country_id'     => $section->country_id,
            'description'    => $section->description
                ? $this->injectStyles() . $section->description . $this->injectScripts()
                : '',
            'is_visible'     => $section->is_visible,
            'can_be_enabled' => $section->canBeEnabled(),
            'available_in'   => $section->translations()
                                        ->get()
                                        ->pluck('locale'),
            'created_at'     => $section->created_at,
            'updated_at'     => $section->updated_at,
        ];
    }
}

Zerion Mini Shell 1.0