/** * Store a newly created resource in storage. * * @return \Illuminate\Support\Facades\Response */ public function store(FormRequest $request) { $data = []; foreach ($request->all() as $key => $value) { $data[$key] = strip_tags($value); } $contact = $this->repository->create($data); event('NewContactRequest', [$contact]); return redirect()->route(config('app.locale') . '.contacts.sent')->with('success', true); }
/** * Update the specified resource in storage. * * @param \TypiCMS\Modules\Contacts\Shells\Models\Contact $contact * @param \TypiCMS\Modules\Contacts\Shells\Http\Requests\FormRequest $request * * @return \Illuminate\Http\RedirectResponse */ public function update(Contact $contact, FormRequest $request) { $this->repository->update($request->all()); return $this->redirect($request, $contact); }