Completed
Push — master ( 029fc1...afa99c )
by guillaume
12:29 queued 06:09
created

GiveAdminRole::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace App\Console\Commands\Debug;
4
5
use App\User;
6
use Illuminate\Console\Command;
7
8
class GiveAdminRole extends Command
9
{
10
    protected $signature = 'debug:give-admin-role {email}';
11
12
    protected $description = 'Give admin role to the user (email) given';
13
14
    public function __construct()
15
    {
16
        parent::__construct();
17
    }
18
19
    public function handle()
20
    {
21
        $email = $this->argument('email');
22
        $user = User::where('email', $email)->first();
23
        $user->assignRole(['admin']);
24
    }
25
}
26