src/Helpers/UI/Label.php
public static function activeStatus($active, array $options = [], $withIcon = true)
    {
        // TODO: Refactor the options to a dedicated config file.
        $classes      = Arr::get($options, 'classes', [
            'enabled'  => 'label label-success',
            'disabled' => 'label label-default',
        ]);
        $translations = Arr::get($options, 'trans', [
            'enabled'  => 'core::statuses.enabled',
            'disabled' => 'core::statuses.disabled',
        ]);
        $icons = Arr::get($options, 'icons', [
            'enabled'  => 'fa fa-fw fa-check',
            'disabled' => 'fa fa-fw fa-ban',
        ]);

        $key        = $active ? 'enabled' : 'disabled';
        $attributes = ['class' => $classes[$key]];

        return $withIcon
            ? static::generateWithIcon(ucfirst(trans($translations[$key])), $icons[$key], $attributes)
            : static::generate(ucfirst(trans($translations[$key])), $attributes);
    }
public static function activeStatus($active, array $options = [], $withIcon = true)
    {
        // TODO: Refactor the options to a dedicated config file.
        $classes      = Arr::get($options, 'classes', [
            'enabled'  => 'label label-success',
            'disabled' => 'label label-default',
        ]);
        $translations = Arr::get($options, 'trans', [
            'enabled'  => 'core::statuses.enabled',
            'disabled' => 'core::statuses.disabled',
        ]);
        $icons = Arr::get($options, 'icons', [
            'enabled'  => 'fa fa-fw fa-check',
            'disabled' => 'fa fa-fw fa-ban',
        ]);

        $key        = $active ? 'enabled' : 'disabled';
        $attributes = ['class' => $classes[$key]];

        return $withIcon
            ? static::generateWithIcon(ucfirst(trans($translations[$key])), $icons[$key], $attributes)
            : static::generate(ucfirst(trans($translations[$key])), $attributes);
    }
public static function activeStatus ( $ active , array $ options = [ ] , $ withIcon = true ) { // TODO: Refactor the options to a dedicated config file. $ classes = Arr :: get ( $ options , 'classes' , [ 'enabled' => 'label label-success' , 'disabled' => 'label label-default' , ] ) ; $ translations = Arr :: get ( $ options , 'trans' , [ 'enabled' => 'core::statuses.enabled' , 'disabled' => 'core::statuses.disabled' , ] ) ; $ icons = Arr :: get ( $ options , 'icons' , [ 'enabled' => 'fa fa-fw fa-check' , 'disabled' => 'fa fa-fw fa-ban' , ] ) ; $ key = $ active ? 'enabled' : 'disabled' ; $ attributes = [ 'class' => $ classes [ $ key ] ] ; return $ withIcon ? static :: generateWithIcon ( ucfirst ( trans ( $ translations [ $ key ] ) ) , $ icons [ $ key ] , $ attributes ) : static :: generate ( ucfirst ( trans ( $ translations [ $ key ] ) ) , $ attributes ) ; }
Generate active status label.

@param  bool   $active
@param  array  $options
@param  bool   $withIcon

@return \Illuminate\Support\HtmlString
Generate active status label .