public function renderDestroy() { $userId = $this->getInt('id'); $user = new User($userId); $user->delete(); Redirect::to('/' . $this->baseUri())->with('msg', new TransportMessage('success', 'User was successfully deleted'))->now(); }
protected function _addUsers() { echo 'Adding Users: '; $users = ['admin' => 'admin']; foreach ($users as $username => $password) { $user = new User(); $user->username = $username; $user->password = password_hash($password, PASSWORD_DEFAULT); $user->saveChanges(); } echo count($users) . PHP_EOL; }