count() == 0) { $subscriber = new Subscriber([ 'code' => $code, 'destination_module' => strtolower($destination_module), 'destination_method' => strtolower($destination_method), 'source_module' => strtolower($source_module), 'source_method' => strtolower($source_method), 'weight' => $weight, ]); $subscriber->save(); } } }