2017-06-21 07:49:45 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
2017-12-10 11:21:49 +08:00
|
|
|
use Setting;
|
2017-06-21 07:49:45 +08:00
|
|
|
|
|
|
|
class SettingsController extends BaseController
|
|
|
|
{
|
2017-06-21 11:48:16 +08:00
|
|
|
/**
|
|
|
|
* Display a listing of setting.
|
|
|
|
*
|
|
|
|
* @return Response
|
|
|
|
*/
|
|
|
|
public function index()
|
|
|
|
{
|
2017-12-10 11:21:49 +08:00
|
|
|
/*$settings = array_filter(Setting::all(), function ($key) {
|
2017-06-21 11:48:16 +08:00
|
|
|
if (strpos($key, '_descrip') !== false) { return true; }
|
|
|
|
return false;
|
2017-12-10 11:21:49 +08:00
|
|
|
});*/
|
|
|
|
$settings = [];
|
2017-06-21 11:48:16 +08:00
|
|
|
|
2017-12-10 11:21:49 +08:00
|
|
|
return view('admin.settings.index',[
|
|
|
|
'settings' => $settings,
|
|
|
|
]);
|
2017-06-21 11:48:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the specified setting in storage.
|
|
|
|
*
|
|
|
|
* @param Setting $setting
|
|
|
|
* @param Request $request
|
|
|
|
*
|
2017-06-21 07:49:45 +08:00
|
|
|
* @return Response
|
|
|
|
*/
|
|
|
|
public function update(Setting $setting, Request $request)
|
2017-06-21 11:48:16 +08:00
|
|
|
{
|
2017-12-10 11:56:26 +08:00
|
|
|
/*$this->validate($request, Setting::$rules, Setting::$messages);
|
2017-12-10 11:21:49 +08:00
|
|
|
$this->updateEntry($setting, $request->all());*/
|
2017-06-21 07:49:45 +08:00
|
|
|
|
2017-12-10 11:56:26 +08:00
|
|
|
return redirect('/admin/settings');
|
2017-06-21 11:48:16 +08:00
|
|
|
}
|
2017-06-21 07:49:45 +08:00
|
|
|
|
|
|
|
}
|