Completed
Push — master ( 5c637a...214bce )
by Julien
03:47
created

Email   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 6
Bugs 0 Features 1
Metric Value
wmc 1
c 6
b 0
f 1
lcom 0
cbo 0
dl 0
loc 37
rs 10

1 Method

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