Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
8 | public function run() |
||
9 | { |
||
10 | $userModelName = config('admin.user'); |
||
11 | $user = new $userModelName(); |
||
12 | if ($user->count() == 0) { |
||
13 | $role = Role::where('name', 'admin')->firstOrFail(); |
||
14 | $user->name = 'admin'; |
||
15 | $user->email = '[email protected]'; |
||
16 | $user->password = encrypt('123456'); |
||
17 | $user->save(); |
||
18 | $user->attachRole($role); |
||
19 | } |
||
20 | } |
||
21 | } |
||
22 |
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.