mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Transformers;
|
|
|
|
use App\Models\BankAccount;
|
|
use League\Fractal\TransformerAbstract;
|
|
|
|
class BankAccountTransformer extends TransformerAbstract
|
|
{
|
|
/**
|
|
* List of resources to automatically include
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $defaultIncludes = [
|
|
//
|
|
];
|
|
|
|
/**
|
|
* List of resources possible to include
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $availableIncludes = [
|
|
'company_business_type'
|
|
];
|
|
|
|
/**
|
|
* A Fractal transformer.
|
|
*
|
|
* @param BankAccount $account
|
|
* @return array
|
|
*/
|
|
public function transform(BankAccount $account): array
|
|
{
|
|
return [
|
|
'id' => $account->id,
|
|
'company_business_type' => $account->company->business_type,
|
|
'type' => $account->type,
|
|
'reference' => $account->reference,
|
|
'bank_name' => $account->bank_name,
|
|
'bank_branch' => $account->bank_branch,
|
|
'holder_name' => $account->holder_name,
|
|
'account_no' => $account->account_no,
|
|
'country_id' => $account->country_id,
|
|
'default' => $account->default,
|
|
'status' => $account->status,
|
|
];
|
|
}
|
|
}
|