mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
36 lines
675 B
PHP
36 lines
675 B
PHP
<?php
|
|
|
|
namespace App\Transformers;
|
|
|
|
use App\Models\Contact;
|
|
use League\Fractal\TransformerAbstract;
|
|
|
|
class ContactTransformer extends TransformerAbstract
|
|
{
|
|
|
|
/**
|
|
* Additional includes to the ContactResource
|
|
*/
|
|
protected array $defaultIncludes = [
|
|
|
|
];
|
|
|
|
/**
|
|
* Transform contact
|
|
* @param Contact $contact
|
|
* @return array
|
|
*/
|
|
public function transform(Contact $contact): array
|
|
{
|
|
return [
|
|
'id' => $contact->id,
|
|
'reference' => $contact->reference,
|
|
'phone' => $contact->phone,
|
|
'email' => $contact->email,
|
|
'wechat_id' => $contact->wechat_id,
|
|
];
|
|
|
|
}
|
|
|
|
}
|