View and Delete Users

This commit implements an interface into the Admin Panel that allows
users to be viewed, modified, and deleted.
This commit is contained in:
BlameDylan 2016-01-01 23:25:41 -06:00
parent 6b25a163fc
commit 6810375d2b
8 changed files with 268 additions and 3 deletions

View file

@ -41,4 +41,36 @@ class UserRepository
}
/**
* Updates a user on the panel. Returns true if the update was successful.
*
* @param string $username
* @param string $email
* @param string $password An unhashed version of the user's password.
* @return boolean
*/
public function update($id, $user)
{
if(array_key_exists('password', $user)) {
$user['password'] = Hash::make($user['password']);
}
User::where('id', $id)->update($user);
return true;
}
/**
* Deletes a user on the panel. Returns true if the deletion was successful.
*
* @param string $username
* @param string $email
* @param string $password An unhashed version of the user's password.
* @return boolean
*/
public function delete($id)
{
User::destroy($id);
return true;
}
}