芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/myvyralapp.com/bck/app/Http/Controllers/Admin/ContactMessageController.php
paginate(); return view('admin.sections.contact-message.index',compact( 'page_title', 'data', )); } /** * Mehtod mail to mail * @method POST * @param Illuminate\Http\Request $request * @return Illuminate\Http\Request Response */ public function emailSend(Request $request){ $validator = Validator::make($request->all(), [ 'email' => 'required', 'data_id' => 'required', 'subject' => 'required|string|max:200', 'message' => 'required|string|max:2000' ]); if($validator->fails()){ return back()->withErrors($validator)->withInput()->with('modal', 'email-contact-user-modal'); } $validated = $validator->validated(); $contact = Contact::findOrFail($validated['data_id']); try { Notification::send($contact, new SendMail((object) $validated)); } catch (\Throwable $th) { return back()->with(['error' => ['Something went worng! Please try again']]); } return back()->with(['success' => ['Email successfully sended']]); } /** * Mehtod for delete subscriber item * @method DELETE * @param Illuminate\Http\Request $request * @return Illuminate\Http\Request Response */ public function delete(Request $request){ $request->validate([ 'target' => 'required|string', ]); $subscriber = Contact::findOrFail($request->target); try { $subscriber->delete(); } catch (\Throwable $th) { return back()->with(['error' => ['Something went worng! Please try again.']]); } return back()->with(['success' => ['Contact Message delete successfully!']]); } }