classes/Controllers/Admins.php
public function search()
    {
        $options = [
            'first_name' => [
                'label' => __('decoy::admins.controller.search.first_name'),
                'type' => 'text',
            ],
            'last_name' => [
                'label' => __('decoy::admins.controller.search.last_name'),
                'type' => 'text',
            ],
            'email' => [
                'label' => __('decoy::admins.controller.search.email'),
                'type' => 'text',
            ],
            'status' => [
                'label' => __('decoy::admins.controller.search.status'),
                'type' => 'select',
                'options' => [
                    1 => __('decoy::admins.controller.search.enabled'),
                    0 => __('decoy::admins.controller.search.disabled'),
                ],
            ],
        ];

        if (($roles = Admin::getRoleTitles()) && count($roles)) {
            $options['role'] = [
                'label' => __('decoy::admins.controller.search.role'),
                'type' => 'select',
                'options' => $roles,
            ];
        }

        return $options;
    }
public function search()
    {
        $options = [
            'first_name' => [
                'label' => __('decoy::admins.controller.search.first_name'),
                'type' => 'text',
            ],
            'last_name' => [
                'label' => __('decoy::admins.controller.search.last_name'),
                'type' => 'text',
            ],
            'email' => [
                'label' => __('decoy::admins.controller.search.email'),
                'type' => 'text',
            ],
            'status' => [
                'label' => __('decoy::admins.controller.search.status'),
                'type' => 'select',
                'options' => [
                    1 => __('decoy::admins.controller.search.enabled'),
                    0 => __('decoy::admins.controller.search.disabled'),
                ],
            ],
        ];

        if (($roles = Admin::getRoleTitles()) && count($roles)) {
            $options['role'] = [
                'label' => __('decoy::admins.controller.search.role'),
                'type' => 'select',
                'options' => $roles,
            ];
        }

        return $options;
    }
public function search ( ) { $ options = [ 'first_name' => [ 'label' => __ ( 'decoy::admins.controller.search.first_name' ) , 'type' => 'text' , ] , 'last_name' => [ 'label' => __ ( 'decoy::admins.controller.search.last_name' ) , 'type' => 'text' , ] , 'email' => [ 'label' => __ ( 'decoy::admins.controller.search.email' ) , 'type' => 'text' , ] , 'status' => [ 'label' => __ ( 'decoy::admins.controller.search.status' ) , 'type' => 'select' , 'options' => [ 1 => __ ( 'decoy::admins.controller.search.enabled' ) , 0 => __ ( 'decoy::admins.controller.search.disabled' ) , ] , ] , ] ; if ( ( $ roles = Admin :: getRoleTitles ( ) ) && count ( $ roles ) ) { $ options [ 'role' ] = [ 'label' => __ ( 'decoy::admins.controller.search.role' ) , 'type' => 'select' , 'options' => $ roles , ] ; } return $ options ; }
Make search options dependent on whether the site is using roles

@return array
Make search options dependent on whether the site is using roles