Ejemplo n.º 1
0
 public function count(Request $request)
 {
     $id = $request->chat_id;
     //dd($id);
     $count = $request->count;
     $query = ['count' => 1];
     $count_record = ChatMeta::where('id', '=', $id)->pluck('count');
     if ($count_record == 0) {
         ChatMeta::insert($query);
     } else {
         $count_record = ChatMeta::where('id', '=', $id)->increment('count');
     }
 }
Ejemplo n.º 2
0
 public function count(Request $request)
 {
     $chat_id = $request->chat_id;
     $mode = $request->mode;
     $count = $request->count;
     $query = ['chat_id' => $chat_id, 'meta_type' => $mode, 'created_at' => Carbon::now()];
     $chat_meta = ChatMeta::create($query);
     $count_sum = ChatMeta::where('chat_id', '=', $chat_id)->where('meta_type', '=', $mode)->count();
     return $count_sum;
 }