From 74cb1477bb921a2378ea22a552b71a48c11e0931 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 20 Jul 2018 16:34:32 +0200 Subject: Better API (integrated oauth completely) --- api/Users/Repositories/UserRepository.php | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 api/Users/Repositories/UserRepository.php (limited to 'api/Users/Repositories/UserRepository.php') diff --git a/api/Users/Repositories/UserRepository.php b/api/Users/Repositories/UserRepository.php new file mode 100644 index 0000000..68416df --- /dev/null +++ b/api/Users/Repositories/UserRepository.php @@ -0,0 +1,35 @@ +getModel(); + + $data['password'] = password_hash($data['password'], PASSWORD_BCRYPT); + + $user->fill($data); + $user->save(); + + return $user; + } + + public function update(User $user, array $data) + { + $user->fill($data); + + $user->save(); + + return $user; + } +} -- cgit v1.2.3