Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
1 | <?php namespace Modules\User\Database\Seeders; |
||
15 | public function run() |
||
16 | { |
||
17 | Model::unguard(); |
||
18 | |||
19 | // Create an admin user |
||
20 | $user = Sentinel::create( |
||
21 | [ |
||
22 | 'email' => '[email protected]', |
||
23 | 'password' => 'test', |
||
24 | 'first_name' => 'Nicolas', |
||
25 | 'last_name' => 'Widart', |
||
26 | ] |
||
27 | ); |
||
28 | // Activate the admin directly |
||
29 | $activation = Activation::create($user); |
||
30 | Activation::complete($user, $activation->code); |
||
31 | |||
32 | // Find the group using the group id |
||
33 | $adminGroup = Sentinel::findRoleBySlug('admin'); |
||
34 | |||
35 | // Assign the group to the user |
||
36 | $adminGroup->users()->attach($user); |
||
37 | } |
||
38 | } |
||
39 |