%PDF- %PDF-
Mini Shell

Mini Shell

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

<?php

namespace App\Transformers;

use App\Models\Category;

class CategoryTransformer extends BaseTransformer
{
    protected $availableIncludes = [

    ];

    /**
     * @param Category $category
     *
     * @return array
     */
    public function transform(Category $category)
    {
        return [
            'id'                => $category->id,
            'slug'              => $category->slug,
            'name'              => $category->name,
            'is_archived'       => $category->is_archived,
            'can_use'           => $category->canUse(),
            'has_notifications' => $category->has_notifications
                ?: false,
            'available_in'      => $category->translations()
                                            ->get()
                                            ->pluck('locale'),
        ];
    }
}

Zerion Mini Shell 1.0