Created
September 15, 2016 13:45
-
-
Save adridev/fae972b07a815227a280d5cabe884ebc to your computer and use it in GitHub Desktop.
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 | |
//... | |
/** | |
* @return mixed | |
*/ | |
protected function buildUserView(\App\Models\User\User $user) | |
{ | |
$userView = new class($user->getAttribute('id'), $user->getAttribute('email'), $user->getAttribute('name')) | |
{ | |
public $name; | |
public $id; | |
public $email; | |
public function __construct($name, $id, $email) | |
{ | |
$this->name = $name; | |
$this->id = $id; | |
$this->email = $email; | |
} | |
}; | |
return $userView; | |
} | |
//... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment