updateOrCreate( ['bind_type' => $bind_type, 'user_id' => $user_id], ['source_id' => $source_id, 'json_data' => $extra_data] ); } public function bindLimitBySource($bind_type, $source_id, $user_id, $extra_data) { // TODO: Implement bindLimitBySource() method. } public function bind($bind_type, $source_id, $user_id, $extra_data) { return UserRelationBind::query()->firstOrCreate( ['bind_type' => $bind_type, 'user_id' => $user_id], ['source_id' => $source_id, 'json_data' => $extra_data] ); } public function isBinded($bind_type, $source_id, $user_id) { // TODO: Implement isBinded() method. } }