Find first record, instead of hardcoded id 1

This commit is contained in:
snipe 2016-06-01 15:50:50 -07:00
parent 9c4cd9c3ce
commit cffa76e627

View file

@ -294,7 +294,7 @@ class SettingsController extends Controller
{
// Check if the asset exists
if (is_null($setting = Setting::find(1))) {
if (is_null($setting = Setting::first())) {
// Redirect to the asset management page with error
return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error'));
}
@ -314,7 +314,6 @@ class SettingsController extends Controller
}
}
$setting->id = '1';
if (config('app.lock_passwords')==false) {
$setting->site_name = e(Input::get('site_name'));