public function tokenInput($name, $url, $value = null, array $options = [])
    {
        $script = '<script type="text/javascript">
        (function ($, undefined) {
            var selector = \'#' . $this->getFieldId($name, $options) . '\';

            $(selector).tokenInput({
                ajax     : {
                    url : \'' . $url . '\',
                    data: {
                        _token: \'' . csrf_token() . '\'
                    },
                    loadByIdentifier: true
                },

                unique   : true,' .
                  (Arr::has($options, 'js.resultFormatterId')
                      ? 'resultFormat: $(\'#' . Arr::get($options, 'js.resultFormatterId') . '\').html(),'
                      : '') . '
                preloaded: ' . Arr::get($options, 'js.preloaded', new Collection())->toJson() . ',
                disabled : ' . (Arr::get($options, 'disabled', false) ? 'true' : 'false') . '
            });
        }(jQuery));
</script>';

        return $this->text($name, $value, $options) . $script;
    }