Created
December 14, 2017 04:42
-
-
Save sirawitpra/ce1449844ac7e8a26f91c4741a813945 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 App\Http\Controllers; | |
use App\Http\Requests\Register; | |
use App\Repositories\UserRepository; | |
use App\Transformers\UserTransformer; | |
class UsersController | |
{ | |
public function register(Register $request) | |
{ | |
$user = app(UserRepository::class)->create($request->only(['email', 'password', 'name'])); | |
$result = UserTransformer::transform($user); | |
return response()->json($result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment