本文整理汇总了PHP中app\Page::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::update方法的具体用法?PHP Page::update怎么用?PHP Page::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Page
的用法示例。
在下文中一共展示了Page::update方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* Update the specified resource in storage.
*
* @param PageRequest|Request $request
* @param Project $project
* @param Module $module
* @param Page $page
* @return \Illuminate\Http\Response
*/
public function update(PageRequest $request, Project $project, Module $module, Page $page)
{
if (isset($_POST['module_id'])) {
$module_id = $_POST['module_id'];
$pages = Page::where('module_id', '=', $module_id)->get();
foreach ($pages as $page) {
$page->update($request->all());
$page->save();
}
return redirect()->route('project.module.show', [$project, $module]);
}
if (isset($_POST['module_name'])) {
$pages = $_POST;
$module = Module::where('project_id', '=', $project->id)->where('name', '=', $_POST['module_name'])->first();
foreach ($pages as $val) {
if (is_numeric($val)) {
$p = Page::where('id', '=', $val)->first();
$p->module_id = $module->id;
$p->save();
}
}
}
$page->update($request->all());
$page->save();
return redirect()->route('project.module.show', [$project, $module]);
}
示例2: update
/**
* Update the specified resource in storage.
*
* @param \App\Page $page
* @param \Illuminate\Http\Request $request
* @return Response
*/
public function update(Page $page, Request $request)
{
$this->validate($request, $this->rules);
$input = array_except(Input::all(), '_method');
$page->update($input);
return Redirect::route('superadmin.pages.index', $page->slug)->with('message', 'Page updated.');
// show after update page
//return view('pages.show', compact('page'));
}
示例3: savePage
/**
* Save a page
*
* @param Request $request
* @param Page $page
* @return $this|\Illuminate\Http\RedirectResponse
*/
public function savePage(Request $request, Page $page)
{
$page->update($request->all());
$page->content = $request->input("editorValue");
$page->save();
return redirect()->back()->with(['status' => 'success', 'message' => '更新成功']);
}
示例4: update
public function update(PageRequest $request, Page $page)
{
$page->update($request->except(['_token']));
return redirect('dash/page')->with('message', 'Page was update success.');
}
示例5: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Page $page, PageRequest $request)
{
//
$input = $request->all();
$page->update($input);
return redirect('paginas');
}
示例6: update
public function update(Page $page)
{
$page->update(Input::all());
return redirect("/admin/pages");
}
示例7: update
function update(Page $page, Request $request)
{
$page->update(['location' => $page->location, 'text' => $request->get('text')]);
$page->save();
return redirect('/')->with(['flash_message' => 'Your page data has been updated successfully.']);
}
示例8: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(PageRequest $request, Page $page)
{
$page->update($request->all());
return redirect('page');
}