Email   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 8
Bugs 0 Features 2
Metric Value
wmc 1
c 8
b 0
f 2
lcom 0
cbo 1
dl 0
loc 33
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 11 1
1
<?php
2
3
namespace App\Console\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Support\Facades\Mail;
7
8
/**
9
 * Task to send an email
10
 * Class Email.
11
 */
12
class Email extends Command
13
{
14
    /**
15
     * The name and signature of the console command.
16
     *
17
     * @var string
18
     */
19
    protected $signature = 'email:send {email} {nom=Boyer}';
20
21
    /**
22
     * The console command description.
23
     *
24
     * @var string
25
     */
26
    protected $description = 'Send an email for an use';
27
28
    /**
29
     * Execute the console command.
30
     *
31
     * @return mixed
32
     */
33
    public function handle()
34
    {
35
        $email = $this->argument('email');
36
        $nom = $this->argument('nom');
37
        Mail::send('Emails/welcome', [], function ($m) use ($email, $nom) {
38
            $m->to($email, $nom)
39
                ->subject('Welcome to the site ');
40
        });
41
42
        $this->info('Finish: Send a email');
43
    }
44
}
45