Last active
December 20, 2018 12:15
-
-
Save thiagomarini/40b4f6a374964b42a6d30a489d92c99a to your computer and use it in GitHub Desktop.
Weengs Service Response Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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