Merge pull request #665 from ladybirdweb/analysis-z3QlZG
Apply fixes from StyleCI
This commit is contained in:
@@ -1052,26 +1052,33 @@ class SettingsController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @category function to return clean data view
|
* @category function to return clean data view
|
||||||
|
*
|
||||||
* @param null
|
* @param null
|
||||||
|
*
|
||||||
* @return respone/view
|
* @return respone/view
|
||||||
*/
|
*/
|
||||||
public function getCleanUpView() {
|
public function getCleanUpView()
|
||||||
|
{
|
||||||
$system_check = CommonSettings::select('status')->where('option_name', '=', 'dummy_data_installation')->first();
|
$system_check = CommonSettings::select('status')->where('option_name', '=', 'dummy_data_installation')->first();
|
||||||
if ($system_check) {
|
if ($system_check) {
|
||||||
if ($system_check->status == 1 || $system_check->status == '1') {
|
if ($system_check->status == 1 || $system_check->status == '1') {
|
||||||
return View('themes.default1.admin.helpdesk.settings.cleandata');
|
return View('themes.default1.admin.helpdesk.settings.cleandata');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->route('error404')->with('fails', Lang::get('lang.no-dummy-data'));
|
return redirect()->route('error404')->with('fails', Lang::get('lang.no-dummy-data'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @category function to clean dummy database and reseed tables with default options
|
* @category function to clean dummy database and reseed tables with default options
|
||||||
|
*
|
||||||
* @param null
|
* @param null
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
* Very dangerous function should be call by admin only
|
* Very dangerous function should be call by admin only
|
||||||
*/
|
*/
|
||||||
private function cleanDatabase() {
|
private function cleanDatabase()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$user = \App\User::select(
|
$user = \App\User::select(
|
||||||
'user_name', 'first_name', 'last_name', 'email', 'password', 'agent_tzone'
|
'user_name', 'first_name', 'last_name', 'email', 'password', 'agent_tzone'
|
||||||
@@ -1118,9 +1125,11 @@ class SettingsController extends Controller
|
|||||||
$bhours->save();
|
$bhours->save();
|
||||||
|
|
||||||
$response = 'success';
|
$response = 'success';
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$error = $e->getMessage();
|
$error = $e->getMessage();
|
||||||
|
|
||||||
return $error;
|
return $error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user