/** * 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]); }
/** * Update the page in storage. * * @param PageRequest $request * @param int $id * @return Response */ public function update($id, PageRequest $request) { $page = Page::findOrFail($id); $page->update($request->all()); flash()->success('Your page has been updated'); return redirect()->action('PagesController@edit', $page->id); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, PageRequest $request) { $page = Page::findOrFail($id); $page->fill($request->all()); $page->modified_by = Auth::user()->id; $page->save(); flash()->success('Page Updated'); return redirect('pages'); }
/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(PageRequest $request) { $input = $request->all(); $input['create_date'] = \Carbon\Carbon::createFromFormat('d-m-Y', $input['create_date'])->format('Y-m-d'); $input['public_date'] = \Carbon\Carbon::createFromFormat('d-m-Y', $input['public_date'])->format('Y-m-d'); $input['show_footer'] = $request->has('show_footer'); $input['show_menu'] = $request->has('show_menu'); $input['show_page'] = $request->has('show_page'); if ($request->input('seo') == null) { $input['seo'] = Str::slug($request->input('name')); } $input['pages_id'] = $request->input('pages_id') != 0 ? $request->input('pages_id') : null; $newPage = Pages::create($input); $this->uploadFiles($newPage['id'], $request->only('filename', 'remove', 'masterPhoto')); return redirect('admin/pages')->with('status', 'Wpis został dodany pomyślnie'); }
/** * Update the specified resource in storage. * * @param CustomerGroupRequest $request * @param int $id * @return Response */ public function update(PageRequest $request, $id) { $page = Page::findorfail($id); $page->update($request->all()); return redirect("/admin/pages"); }
/** * Update the specified page in storage. * * @param Page $page * @param PageRequest $request * @return Response */ public function update(Page $page, PageRequest $request) { $page->fill($request->all()); $page->save() == true ? Flash::success(trans('admin.update.success')) : Flash::error(trans('admin.update.fail')); return redirect(route('admin.page.index')); }
/** * Update the specified resource in storage. * * @param PageRequest|Request $request * @param Page $page * @return \Illuminate\Http\Response */ public function update(PageRequest $request, Page $page) { $page->update($request->all()); flash()->success('Updated page successfully'); return Redirect::back(); }
/** * 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'); }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(PageRequest $request, $id) { Page::find($id)->update($request->all()); return redirect('admin/pages')->with(['message' => trans('admin/pages.message.update_success')]); }
public function update(PageRequest $request, Page $page) { if (!Entrust::can('edit_page')) { return redirect('/dashboard')->withErrors(config('constants.NA')); } $data = $request->all(); $page->fill($data); $page->page_slug = Helper::createSlug($data['page_title']); $page->save(); Helper::updateCustomField($this->form, $page->id, $data); $activity = 'Edit a page'; Activity::log($activity); return redirect('/page')->withSuccess(config('constants.SAVED')); }
/** * Update a page. * * @param $id, PageRequest $request * * @return array */ public function update($id, PageRequest $request) { $page = Page::findOrFail($id); $page->update($request->all()); return redirect('pages'); }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, PageRequest $request) { $page = Article::findOrFail($id); $page->update($request->all()); $page->updateCat(['cat' => [1, $request->input('cat')], 'id' => $id]); Cache::flush(); flash()->success(trans('pages.updated')); return redirect(action('Admin\\PagesController@index')); }
/** * 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'); }