public function AdminSettings user Lex Admin getUserById Auth user adm

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public function AdminSettings()
{
$user = \Lex\Admin::getUserById(\Auth::user()->admin_id);
if ($user) {
if (\Input::has('allow_remove')) {
$config_string = '';
foreach ($_POST as $key => $value) {
$config_string .= '\''.$key.'\' => \''.intval($value[0]).' '.$value[1].'\',';
}
$config = '<?php return ['.$config_string.'];';
$path = app_path().'/config/transactions.php';
file_put_contents($path, $config);
return \Redirect::to(\URL::route('AdminSettings'))
->with('success', 'ok');
}
return [
'user' => $user,
'config' => \Config::get('transactions'),
'time_interval' => Base::getTimeIntervalList()
];
}
}