FEATURE: add soft deletes to users

This commit is contained in:
Michal Kváček
2016-09-22 22:13:15 +02:00
parent d5d4216a80
commit 0357417163
5 changed files with 66 additions and 8 deletions
+1 -2
View File
@@ -25,8 +25,7 @@ class EditUser extends Controller
// @todo add some authorization (e.g. via can/cannot methods)
// try to find given user
$user = User::where('status', '!=', User::STATE_DELETED)
->findOrFail($id);
$user = User::findOrFail($id);
$states = UserStates::getWithTranslations();
$roles = UserRoles::getWithTranslations();
+1 -3
View File
@@ -12,13 +12,11 @@ class UsersOverview extends Controller
{
public function getOverview($status = null, $perPage = 12)
{
$users = User::where('status', '<>', User::STATE_DELETED)
->orderBy('id', 'desc');
$users = User::orderBy('id', 'desc');
// get statuses
$statuses = UserStates::getWithTranslations();
$statuses[''] = trans('admin/userManagement.allStatuses');
unset($statuses[User::STATE_DELETED]);
// filter using status
if (!is_null($status) && isset($statuses[$status])) {