Conditions | 1 |
Paths | 1 |
Total Lines | 47 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | public function run() |
||
9 | { |
||
10 | $admin = Sentinel::registerAndActivate(array( |
||
11 | 'email' => '[email protected]', |
||
12 | 'password' => 'admin', |
||
13 | 'first_name' => 'John', |
||
14 | 'last_name' => 'Doe', |
||
15 | 'status' => 1, |
||
16 | )); |
||
17 | |||
18 | $adminRole = Sentinel::getRoleRepository()->createModel()->create([ |
||
19 | 'name' => 'Admin', |
||
20 | 'slug' => 'admin', |
||
21 | 'permissions' => array('admin' => 1), |
||
22 | ]); |
||
23 | |||
24 | Base::getSettingsRepository()->createModel()->create([ |
||
25 | 'friendly_name' => 'SITE_NAME', |
||
26 | 'name' => 'Website name', |
||
27 | 'value' => 'John Doe\'s website', |
||
28 | 'description' => 'Website name', |
||
29 | ]); |
||
30 | |||
31 | Base::getSettingsRepository()->createModel()->create([ |
||
32 | 'friendly_name' => 'USER_REGISTRATION', |
||
33 | 'name' => 'User registration status', |
||
34 | 'value' => '1', |
||
35 | 'description' => '/* |
||
36 | * 0 - Disabled |
||
37 | * 1 - Enabled and no activation |
||
38 | * 2 - User activation |
||
39 | * 3 - Admin activation |
||
40 | */', |
||
41 | ]); |
||
42 | |||
43 | |||
44 | /* |
||
45 | Sentinel::getRoleRepository()->createModel()->create([ |
||
46 | 'name' => 'User', |
||
47 | 'slug' => 'user', |
||
48 | ]); |
||
49 | |||
50 | $admin->roles()->attach($adminRole); |
||
51 | */ |
||
52 | |||
53 | |||
54 | } |
||
55 | |||
56 | } |
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.