芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/www/app/Http/Controllers/Admin/PlanSectionController.php
all(); // Record to database PlanSection::firstOrCreate([ 'language_id' => getLanguage()->id, 'section_title' => Purifier::clean($input['section_title']), 'title' => Purifier::clean($input['title']), ]); // Set a success toast, with a title toastr()->success('content.created_successfully', 'content.success'); return redirect()->route('plan.create'); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // Get All Request $input = $request->all(); // XSS Purifier $input['section_title'] = Purifier::clean($input['section_title']); $input['title'] = Purifier::clean($input['title']); // Update model PlanSection::find($id)->update($input); // Set a success toast, with a title toastr()->success('content.updated_successfully', 'content.success'); return redirect()->route('plan.create'); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // Retrieve a model $item_section = PlanSection::find($id); $item_section->delete(); // Set a success toast, with a title toastr()->success('content.deleted_successfully', 'content.success'); return redirect()->route('plan.create'); } }