本文整理汇总了PHP中app\Setting::fill方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::fill方法的具体用法?PHP Setting::fill怎么用?PHP Setting::fill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Setting
的用法示例。
在下文中一共展示了Setting::fill方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: patchSettings
/**
* Update the settings in storage.
*
* @param Setting $setting
* @param SettingRequest $request
* @return Response
*/
public function patchSettings(Setting $setting, SettingRequest $request)
{
$data = $this->storeImage($request, 'logo');
$setting->fill($data);
$setting->save() == true ? Flash::success(trans('admin.update.success')) : Flash::error(trans('admin.update.fail'));
return redirect(route('admin.setting.index'));
}
示例2: update
public function update(Request $request, Setting $setting)
{
$insert = $setting->fill($request->input())->save();
$image = \Input::get('image');
if ($image != '') {
$imagename = 'setting-' . rand(11111, 99999) . '-gudperna.png';
$image = str_replace(' ', '+', $image);
list($type, $image) = explode(';', $image);
list(, $image) = explode(',', $image);
$image = base64_decode($image);
file_put_contents('upload/img/' . $imagename, $image);
$setting->image = $imagename;
$setting->save();
}
if ($insert) {
return 0;
} else {
return 1;
}
}
示例3: settingsSave
public function settingsSave(Request $request)
{
$s = Setting::first();
if (!$s) {
$s = new Setting();
}
$s->fill($request->all());
$s->save();
return redirect('/dashboard/settings');
}
示例4: patchSettings
/**
* Update the settings in storage.
*
* @param Setting $setting
* @param SettingRequest $request
* @return Response
*/
public function patchSettings(Setting $setting, SettingRequest $request)
{
$setting->fill(ImageService::uploadImage($request, 'logo'));
$setting->save() ? Flash::success(trans('admin.update.success')) : Flash::error(trans('admin.update.fail'));
return redirect(route('admin.setting.index'));
}