ldc-com-app-bo/app/Http/Resources/ContactResource.php
2023-07-24 12:06:21 +02:00

41 lines
1.3 KiB
PHP

<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class ContactResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
*/
public function toArray($request)
{
//phpcs:enable
return [
'id' => $this->id,
'email' => $this->email,
'type' => $this->type,
'other' => $this->other,
'select1' => $this->select1,
'select2' => $this->select2,
'name' => $this->lastname,
'firstname' => $this->firstname,
'company' => $this->company,
'address' => $this->address,
'phone' => $this->phone,
'products' => $this->products,
'card_url' => $this->card_url,
'notes' => $this->notes,
'visits' => $this->visits,
'user_id' => $this->app_user_id,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}