private function createRolesAndPermissions()
    {
        $permissions = [];

        $permissions[] = [
            'name'     => 'admin-access',
            'category' => 'general'
        ];

        $entities = ['content', 'block', 'user', 'file', 'role'];
        foreach ($entities as $entity) {
            $permissions[] = [
                'name'     => $entity . '-create',
                'category' => $entity
            ];
            $permissions[] = [
                'name'     => $entity . '-read',
                'category' => $entity
            ];
            $permissions[] = [
                'name'     => $entity . '-update',
                'category' => $entity
            ];
            $permissions[] = [
                'name'     => $entity . '-delete',
                'category' => $entity
            ];
        }

        // Options are different
        $permissions[] = [
            'name'     => 'options-read',
            'category' => 'options'
        ];
        $permissions[] = [
            'name'     => 'options-update-general',
            'category' => 'options'
        ];
        $permissions[] = [
            'name'     => 'options-update-seo',
            'category' => 'options'
        ];

        Permission::insert($permissions);

        $adminRole = Role::create(['name' => 'Admin']);
        $user      = User::find(1);
        $user->roles()->attach($adminRole);
        $adminRole->permissions()->attach(Permission::all(['id'])->pluck('id')->toArray());

        $moderatorRole = Role::create(['name' => 'Moderator']);
        $permissionIds = Permission::whereIn('category', ['block', 'content', 'file'])
            ->orWhereIn('name', ['admin-access'])
            ->get(['id'])
            ->pluck('id')
            ->toArray();
        $moderatorRole->permissions()->attach($permissionIds);

    }