public function getIsActiveLabelAttribute()
    {
        $title = 'Not Active';
        $class = 'danger';

        $from = Carbon::parse($this->active_from);
        $to = Carbon::parse($this->active_to);

        if (!$this->active_to || Carbon::now()->diffInMinutes($to, false) > 0) {
            if (Carbon::now()->diffInMinutes($from, false) < 0) {
                $title = 'Active';
                $class = 'success';
            }
        }

        return "<span class='label label-{$class}'>{$title}</span>";
    }
public function getIsActiveLabelAttribute()
    {
        $title = 'Not Active';
        $class = 'danger';

        $from = Carbon::parse($this->active_from);
        $to = Carbon::parse($this->active_to);

        if (!$this->active_to || Carbon::now()->diffInMinutes($to, false) > 0) {
            if (Carbon::now()->diffInMinutes($from, false) < 0) {
                $title = 'Active';
                $class = 'success';
            }
        }

        return "<span class='label label-{$class}'>{$title}</span>";
    }
public function getIsActiveLabelAttribute ( ) { $ title = 'Not Active' ; $ class = 'danger' ; $ from = Carbon :: parse ( $ this -> active_from ) ; $ to = Carbon :: parse ( $ this -> active_to ) ; if ( ! $ this -> active_to || Carbon :: now ( ) -> diffInMinutes ( $ to , false ) > 0 ) { if ( Carbon :: now ( ) -> diffInMinutes ( $ from , false ) < 0 ) { $ title = 'Active' ; $ class = 'success' ; } } return "<span class='label label-{$class}'>{$title}</span>" ; }
Get the is active label attribute
@return string
Get the is active label attribute