Code Duplication    Length = 14-16 lines in 3 locations

src/Traits/Request.php 3 locations

@@ 48-63 (lines=16) @@
45
     * @param array $payload
46
     * @return Model
47
     */
48
    public function find($payload)
49
    {
50
        $this->method = 'GET';
51
        $this->payload = $payload;
52
        $this->apiUrl = $this->apiUrl . $payload;
53
54
        $this->setOptions([
55
            'headers' => [
56
                'Accept' => 'application/json',
57
                'Content-type' => 'application/json'
58
            ],
59
            'auth' => [config('paymongo.secret_key'), ''],
60
        ]);
61
62
        return $this->request();
63
    }
64
65
    public function all()
66
    {
@@ 80-93 (lines=14) @@
77
        return $this->request();
78
    }
79
80
    public function enable(Webhook $webhook)
81
    {
82
        $this->method = 'POST';
83
        $this->apiUrl = $this->apiUrl . "$webhook->id/enable";
84
85
        $this->setOptions([
86
            'headers' => [
87
                'Accept' => 'application/json',
88
            ],
89
            'auth' => [config('paymongo.secret_key'), ''],
90
        ]);
91
92
        return $this->request();
93
    }
94
95
    public function disable(Webhook $webhook)
96
    {
@@ 95-108 (lines=14) @@
92
        return $this->request();
93
    }
94
95
    public function disable(Webhook $webhook)
96
    {
97
        $this->method = 'POST';
98
        $this->apiUrl = $this->apiUrl . "$webhook->id/disable";
99
100
        $this->setOptions([
101
            'headers' => [
102
                'Accept' => 'application/json',
103
            ],
104
            'auth' => [config('paymongo.secret_key'), ''],
105
        ]);
106
107
        return $this->request();
108
    }
109
110
    public function update(Webhook $webhook, $payload)
111
    {