| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function run() |
||
| 15 | { |
||
| 16 | $adminGroup = \DB::table('groups')->where('name', 'Admin')->first(); |
||
| 17 | $adminGroupId = $adminGroup ? $adminGroup->id : 0; |
||
| 18 | |||
| 19 | $adminUser = \DB::table('users')->where('email', '[email protected]')->first(); |
||
| 20 | $adminUserId = $adminUser ? $adminUser->id : 0; |
||
| 21 | |||
| 22 | $permissions = \DB::table('permissions')->whereIn('model', ['users', 'permissions', 'groups']); |
||
| 23 | |||
| 24 | \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
||
| 25 | \DB::table('users_groups')->where('user_id', $adminUserId)->where('group_id', $adminGroupId)->delete(); |
||
| 26 | |||
| 27 | \DB::table('users')->where('email', '[email protected]')->delete(); |
||
| 28 | \DB::table('groups')->where('name', 'Admin')->delete(); |
||
| 29 | |||
| 30 | $permissions->delete(); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |