/** * Get the translated status name. * * @return string|null */ protected function formatStatus() { $status = $this->model->status; $translations = UserStatus::getTranslations(); return data_get($translations, $status); }
/** * Show the deleted users list. * * @param TrashedUserFilter $filter * @return \Illuminate\View\View */ public function getTrashedIndex(TrashedUserFilter $filter) { $users = $this->users->getFilteredListOfDeletedUsers($filter); $users->transform(function ($user) { return new UserViewModel($user); }); $filter = $filter->getFilterView(); $status = UserStatus::getTranslations(); $roles = $this->roles->getKeyedRolesArray(); return view('admin.users.list-trash', compact('users', 'filter', 'status', 'roles')); }
/** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return ['keywords' => 'max:150', 'status' => 'in:' . implode(',', UserStatus::getConstants()), 'role' => 'exists:roles,id']; }