Code Duplication    Length = 9-10 lines in 2 locations

app/Helpers/Mail.php 1 location

@@ 28-36 (lines=9) @@
25
     * @param array  $configuration
26
     * @param string $view
27
     */
28
    public function send(array $configuration, string $view = 'habbo-web-mail.confirm-mail')
29
    {
30
        if (Config::get('mail.enable')) {
31
            MailFacade::send($view, $configuration, function ($message) use ($configuration) {
32
                $message->from(Config::get('mail.from.address'), Config::get('mail.from.name'));
33
                $message->to($configuration['email'])->subject($configuration['subject']);
34
            });
35
        }
36
    }
37
38
    /**
39
     * Store an E-mail.

app/Http/Controllers/MailController.php 1 location

@@ 21-30 (lines=10) @@
18
     * @param array  $configuration
19
     * @param string $view
20
     */
21
    public function send(array $configuration, string $view = 'habbo-web-mail.confirm-mail')
22
    {
23
        if (!Config::get('mail.enable')) {
24
            return;
25
        }
26
27
        Mail::send($view, $configuration, function ($message) use ($configuration) {
28
            $message->from(Config::get('mail.from.address'), Config::get('mail.from.name'));
29
            $message->to($configuration['email'])->subject($configuration['subject']);
30
        });
31
    }
32
33
    /**