芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/store.kwesioben.com/app/Http/Controllers/api/v1/GeneralController.php
json(HelpTopic::orderBy('ranking')->get(),200); } public function get_guest_id(Request $request){ $guest_id = GuestUser::insertGetId([ 'ip_address' => $request->ip(), 'created_at' => now(), ]); return response()->json(['guest_id'=>$guest_id],200); } public function contact_store(Request $request) { $validator = Validator::make($request->all(), [ 'mobile_number' => 'required', 'subject' => 'required', 'message' => 'required', 'email' => 'required', 'name' => 'required', ], [ 'name.required' => 'Name is Empty!', 'mobile_number.required' => 'Mobile Number is Empty!', 'subject.required' => ' Subject is Empty!', 'message.required' => 'Message is Empty!', 'email.required' => 'Email is Empty!', ]); if ($validator->fails()) { return response()->json(['errors' => Helpers::error_processor($validator)], 403); } $contact = new Contact; $contact->name = $request->name; $contact->email = $request->email; $contact->mobile_number = $request->mobile_number; $contact->subject = $request->subject; $contact->message = $request->message; $contact->save(); return response()->json(['message'=>'Your Message Send Successfully'], 200); } }