芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/bit-alphas-ltd.com/user/project/app/Http/Controllers/Admin/FaqController.php
editColumn('details', function(Faq $data) { $details = mb_strlen(strip_tags($data->details),'utf-8') > 100 ? mb_substr(strip_tags($data->details),0,100,'utf-8').'...' : strip_tags($data->details); return $details; }) ->addColumn('action', function(Faq $data) { return '
'.'Actions' .'
'.__("Edit").'
'.__("Delete").'
'; }) ->rawColumns(['action']) ->toJson(); //--- Returning Json Data To Client Side } public function index() { return view('admin.faq.index'); } public function create() { return view('admin.faq.create'); } public function store(Request $request) { $data = new Faq(); $input = $request->all(); $data->fill($input)->save(); //--- Redirect Section $msg = 'New Data Added Successfully.'.'
View Faq Lists
'; return response()->json($msg); //--- Redirect Section Ends } public function edit($id) { $data = Faq::findOrFail($id); return view('admin.faq.edit',compact('data')); } public function update(Request $request, $id) { $data = Faq::findOrFail($id); $input = $request->all(); $data->update($input); //--- Logic Section Ends //--- Redirect Section $msg = 'Data Updated Successfully.'.'
View Faq Lists
'; return response()->json($msg); //--- Redirect Section Ends } public function destroy($id) { $data = Faq::findOrFail($id); $data->delete(); //--- Redirect Section $msg = 'Data Deleted Successfully.'; return response()->json($msg); //--- Redirect Section Ends } }