public function putBanAndDeleteThreads($userId) { // Ban the user $user = $this->users->requireById($userId); $user->is_banned = 1; $this->users->save($user); // Remove all threads by the user $this->threads->deleteByAuthorId($userId); return $this->redirectAction('Admin\\UsersController@getIndex', ['success' => 'The user has been banned and its threads have been removed.']); }