Example #1
0
 public function store(CreateRequest $request)
 {
     $contact = new ContactMessage();
     $contact->fill($request->all());
     $contact->save();
     return response()->json(true, 200, [], JSON_NUMERIC_CHECK);
 }
Example #2
0
 public function reply(Request $request)
 {
     $msg = Contact::find(request('msg_id'));
     $msg->is_replied = 1;
     $msg->comment = request('comment');
     $msg->save();
     $this->dispatch(new SendReplyEmail($msg->email, request('comment')));
     $message = 'تم الحفظ';
     return redirect()->route('contact.show', $msg->id)->with('success', $message);
 }
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     //ContactMessage
     ContactMessage::created(function ($message) {
         UserLog::create(['operation' => 'create', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Contact_message', 'reference_id' => $message->id]);
     });
     ContactMessage::updated(function ($message) {
         UserLog::create(['operation' => 'update', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Contact_message', 'reference_id' => $message->id]);
     });
     ContactMessage::deleted(function ($message) {
         UserLog::create(['operation' => 'delete', 'user_id' => user() ? user()->id : NULL, 'reference_key' => 'Contact_message', 'reference_id' => $message->id]);
     });
 }