Code Duplication    Length = 10-11 lines in 2 locations

src/Drivers/Kavenegar.php 1 location

@@ 44-53 (lines=10) @@
41
    {
42
        try {
43
            $response = ['status' => true, 'data' =>[]];
44
            foreach ($this->recipients as $recipient) {
45
                $sms = $this->client->Send(
46
                    $this->settings->from,
47
                    $recipient,
48
                    $this->body
49
                );
50
                $response['data'][$recipient] = $this->getSmsResponse(
51
                    json_decode($sms, true)
52
                );
53
            }
54
        } catch (\Exception $e) {
55
            $response['status'][$recipient] = false;
56
            $response['data'][$recipient] = $e->getMessage();

src/Drivers/Melipayamak.php 1 location

@@ 57-67 (lines=11) @@
54
    {
55
        try {
56
            $response = ['status' => true, 'data' =>[]];
57
            foreach ($this->recipients as $recipient) {
58
                $sms = $this->client->sms()->send(
59
                    $recipient,
60
                    $this->settings->from,
61
                    $this->body,
62
                    $this->settings->flash
63
                );
64
                $response['data'][$recipient] = $this->getSmsResponse(
65
                    json_decode($sms, true)
66
                );
67
            }
68
        } catch (\Exception $e) {
69
            $response['status'][$recipient] = false;
70
            $response['data'][$recipient] = $e->getMessage();