public function index(User $user, Collection $areaProvidersCollection)
    {
        $items = [];

        foreach ($areaProvidersCollection as $areaProviders) {
            /* @var $areaProviders AreaProviders */

            $enabled = $areaProviders->getEnabledModel();

            if (!$enabled instanceof Provider) {
                continue;
            }

            $area = $areaProviders->getArea();

            if ($enabled->isForced()) {
                $items[] = [
                    'area' => $area,
                    'line' => trans('antares/two_factor_auth::configuration.activated'),
                ];
            } elseif ($this->userProviderConfigService->hasEnabledArea($area)) {
                $url   = handles('two_factor_auth.user.configuration.disable', compact('area', 'user'));
                $attrs = [
                    'class'            => 'triggerable confirm',
                    'data-title'       => trans('antares/two_factor_auth::configuration.disable.title'),
                    'data-description' => trans('antares/two_factor_auth::configuration.disable.prompt'),
                    'data-icon'        => 'minus',
                ];

                $items[] = [
                    'area' => $area,
                    'line' => HTML::link($url, trans('antares/two_factor_auth::configuration.disable.label'), $attrs),
                ];
            } else {
                $url   = handles('two_factor_auth.user.configuration.enable', compact('area', 'user'));
                $attrs = [
                    'class'            => 'triggerable confirm',
                    'data-title'       => trans('antares/two_factor_auth::configuration.enable.title'),
                    'data-description' => trans('antares/two_factor_auth::configuration.enable.prompt'),
                    'data-icon'        => 'minus',
                ];

                $items[] = [
                    'area' => $area,
                    'line' => HTML::link($url, trans('antares/two_factor_auth::configuration.enable.label'), $attrs),
                ];
            }
        }

        return $items;
    }
public function index(User $user, Collection $areaProvidersCollection)
    {
        $items = [];

        foreach ($areaProvidersCollection as $areaProviders) {
            /* @var $areaProviders AreaProviders */

            $enabled = $areaProviders->getEnabledModel();

            if (!$enabled instanceof Provider) {
                continue;
            }

            $area = $areaProviders->getArea();

            if ($enabled->isForced()) {
                $items[] = [
                    'area' => $area,
                    'line' => trans('antares/two_factor_auth::configuration.activated'),
                ];
            } elseif ($this->userProviderConfigService->hasEnabledArea($area)) {
                $url   = handles('two_factor_auth.user.configuration.disable', compact('area', 'user'));
                $attrs = [
                    'class'            => 'triggerable confirm',
                    'data-title'       => trans('antares/two_factor_auth::configuration.disable.title'),
                    'data-description' => trans('antares/two_factor_auth::configuration.disable.prompt'),
                    'data-icon'        => 'minus',
                ];

                $items[] = [
                    'area' => $area,
                    'line' => HTML::link($url, trans('antares/two_factor_auth::configuration.disable.label'), $attrs),
                ];
            } else {
                $url   = handles('two_factor_auth.user.configuration.enable', compact('area', 'user'));
                $attrs = [
                    'class'            => 'triggerable confirm',
                    'data-title'       => trans('antares/two_factor_auth::configuration.enable.title'),
                    'data-description' => trans('antares/two_factor_auth::configuration.enable.prompt'),
                    'data-icon'        => 'minus',
                ];

                $items[] = [
                    'area' => $area,
                    'line' => HTML::link($url, trans('antares/two_factor_auth::configuration.enable.label'), $attrs),
                ];
            }
        }

        return $items;
    }
public function index ( User $ user , Collection $ areaProvidersCollection ) { $ items = [ ] ; foreach ( $ areaProvidersCollection as $ areaProviders ) { /* @var $areaProviders AreaProviders */ $ enabled = $ areaProviders -> getEnabledModel ( ) ; if ( ! $ enabled instanceof Provider ) { continue ; } $ area = $ areaProviders -> getArea ( ) ; if ( $ enabled -> isForced ( ) ) { $ items [ ] = [ 'area' => $ area , 'line' => trans ( 'antares/two_factor_auth::configuration.activated' ) , ] ; } elseif ( $ this -> userProviderConfigService -> hasEnabledArea ( $ area ) ) { $ url = handles ( 'two_factor_auth.user.configuration.disable' , compact ( 'area' , 'user' ) ) ; $ attrs = [ 'class' => 'triggerable confirm' , 'data-title' => trans ( 'antares/two_factor_auth::configuration.disable.title' ) , 'data-description' => trans ( 'antares/two_factor_auth::configuration.disable.prompt' ) , 'data-icon' => 'minus' , ] ; $ items [ ] = [ 'area' => $ area , 'line' => HTML :: link ( $ url , trans ( 'antares/two_factor_auth::configuration.disable.label' ) , $ attrs ) , ] ; } else { $ url = handles ( 'two_factor_auth.user.configuration.enable' , compact ( 'area' , 'user' ) ) ; $ attrs = [ 'class' => 'triggerable confirm' , 'data-title' => trans ( 'antares/two_factor_auth::configuration.enable.title' ) , 'data-description' => trans ( 'antares/two_factor_auth::configuration.enable.prompt' ) , 'data-icon' => 'minus' , ] ; $ items [ ] = [ 'area' => $ area , 'line' => HTML :: link ( $ url , trans ( 'antares/two_factor_auth::configuration.enable.label' ) , $ attrs ) , ] ; } } return $ items ; }
Returns an array with supported areas and link.

@param User $user
@param Collection $areaProvidersCollection
@return array
Returns an array with supported areas and link .