Conditions | 1 |
Paths | 1 |
Total Lines | 39 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | public function run() |
||
7 | { |
||
8 | |||
9 | $admin = Sentinel::registerAndActivate(array( |
||
10 | 'email' => '[email protected]', |
||
11 | 'password' => 'admin', |
||
12 | 'first_name' => 'John', |
||
13 | 'last_name' => 'Doe', |
||
14 | 'status' => 1, |
||
15 | )); |
||
16 | |||
17 | $adminRole = Sentinel::getRoleRepository()->createModel()->create([ |
||
18 | 'name' => 'Admin', |
||
19 | 'slug' => 'admin', |
||
20 | 'permissions' => array('admin' => 1), |
||
21 | ]); |
||
22 | |||
23 | Base::getSettingsRepository()->createModel()->create([ |
||
24 | 'friendly_name' => 'SITE_NAME', |
||
25 | 'name' => 'Website name', |
||
26 | 'value' => 'John Doe\'s website', |
||
27 | 'description' => 'Website name', |
||
28 | ]); |
||
29 | |||
30 | Base::getSettingsRepository()->createModel()->create([ |
||
31 | 'friendly_name' => 'USER_REGISTRATION', |
||
32 | 'name' => 'User registration status', |
||
33 | 'value' => '1', |
||
34 | 'description' => '/* |
||
35 | * 0 - Disabled |
||
36 | * 1 - Enabled and no activation |
||
37 | * 2 - User activation |
||
38 | * 3 - Admin activation |
||
39 | */', |
||
40 | ]); |
||
41 | |||
42 | $admin->roles()->attach($adminRole); |
||
43 | |||
44 | } |
||
45 | |||
46 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.