Skip to content

Instantly share code, notes, and snippets.

@thiagomarini
Last active December 20, 2018 12:15
Show Gist options
  • Save thiagomarini/40b4f6a374964b42a6d30a489d92c99a to your computer and use it in GitHub Desktop.
Save thiagomarini/40b4f6a374964b42a6d30a489d92c99a to your computer and use it in GitHub Desktop.
Weengs Service Response Example
<?php
namespace Weengs\Services\Merchant\Onboarding\RequestPhoneCall;
use Weengs\Models\User\User;
use Weengs\Services\Common\BaseServiceResponse;
class Response extends BaseServiceResponse
{
/**
* @var User
*/
private $user;
/**
* @param User $user
*/
public function __construct(User $user)
{
parent::__construct();
$this->user = $user;
}
/**
* @return array
*/
public function getData(): array
{
$response = [
'onboarding' => $this->user->onboarding->toResource(),
'user' => $this->user->toResource()
];
return $response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment