%PDF- %PDF-
Mini Shell

Mini Shell

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

<?php

namespace App\Transformers;


use App\Models\AnnualLeave;

class AnnualLeaveTransformer extends BaseTransformer
{

    protected $availableIncludes = [
        'transactions',
    ];

    public function includeTransactions(AnnualLeave $leave)
    {
        return $this->collection($leave->transactions, new AnnualLeaveTransactionTransformer(), 'transactions');
    }

    public function transform(AnnualLeave $leave)
    {
        return [
            'id'       => $leave->id,
            'quantity' => $leave->quantity,
        ];
    }

}

Zerion Mini Shell 1.0