Conditions | 2 |
Paths | 2 |
Total Lines | 26 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function run() |
||
31 | { |
||
32 | DB::statement('SET FOREIGN_KEY_CHECKS=0;'); |
||
33 | DB::table(config('rinvex.fort.tables.users'))->truncate(); |
||
34 | |||
35 | $user = [ |
||
36 | 'username' => 'Fort', |
||
37 | 'email' => '[email protected]', |
||
38 | 'email_verified' => true, |
||
39 | 'email_verified_at' => Carbon::now(), |
||
40 | 'remember_token' => str_random(10), |
||
41 | 'password' => $password = str_random(), |
||
42 | 'active' => true, |
||
43 | ]; |
||
44 | |||
45 | $user = User::create($user); |
||
46 | |||
47 | if (isset($this->command)) { |
||
48 | $this->command->getOutput()->writeln("<comment>Username</comment>: {$user['username']} / <comment>Password</comment>: {$password}"); |
||
|
|||
49 | } |
||
50 | |||
51 | // Assign roles to users |
||
52 | $user->assignRoles('admin'); |
||
53 | |||
54 | DB::statement('SET FOREIGN_KEY_CHECKS=1;'); |
||
55 | } |
||
56 | } |
||
57 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.