%PDF- %PDF-
Direktori : /var/www/html/management/app/Transformers/ |
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, ]; } }