where("action",'=',$action)->where("source_id","=",$source_id)->where("source_type","=",$source_type)->count(); if( $doings > 0 ) { return false; } try{ return Doing::create([ 'user_id' => $user_id, 'action' => $action, 'source_id' => $source_id, 'source_type' => $source_type, 'subject' => $subject, 'content' => strip_tags($content), 'refer_id' => $refer_id, 'refer_user_id' => $refer_user_id, 'refer_content' => strip_tags($refer_content), 'created_at' => Carbon::now() ]); }catch (\Exception $e){ Log::error('doing_service_error:'.$e->getMessage()); return false; } } }