GrafiteInc/Forms

View on GitHub
src/Fields/Bootstrap/Day.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Grafite\Forms\Fields\Bootstrap;

use Grafite\Forms\Fields\Bootstrap\TomSelect;

class Day extends TomSelect
{
    protected static function getType()
    {
        return 'select';
    }

    protected static function getOptions()
    {
        return [
            'options' => [
                'Sunday' => 'sunday',
                'Monday' => 'monday',
                'Tuesday' => 'tuesday',
                'Wednesday' => 'wednesday',
                'Thursday' => 'thursday',
                'Friday' => 'friday',
                'Saturday' => 'saturday',
            ],
        ];
    }

    protected static function getAttributes()
    {
        return [
            'class' => 'w-100 form-control',
            'multiple' => false,
            'null_label' => 'Please select a day',
            'null_value' => null,
            'data-size' => 8,
        ];
    }
}