diff --git a/src/Efficiently/JqueryLaravel/helpers.php b/src/Efficiently/JqueryLaravel/helpers.php index 4598f24..92c72b5 100644 --- a/src/Efficiently/JqueryLaravel/helpers.php +++ b/src/Efficiently/JqueryLaravel/helpers.php @@ -225,6 +225,7 @@ function dom_class($recordOrClass, $prefix = null) * 'action' - open forms that point to controller actions. E.G. ['action' => 'Controller@method'] * 'method' - HTTP verb. Supported verbs are 'post', 'get', 'delete', 'patch', and 'put'. By default it will be 'post'. * 'data-remote' - If set to true, will allow the Unobtrusive JavaScript drivers to control the submit behavior. By default this behavior is an ajax submit. + * 'data-confirm' - This will use the unobtrusive JavaScript driver to prompt with the question specified. If the user accepts, the link is processed normally, otherwise no action is taken. * 'form' - This array will be form attributes * 'formClass' - This controls the class of the form within which the submit button will be placed. By default it will be 'button_to'. * @return string @@ -248,6 +249,9 @@ function button_to($name, array $options = []) if (array_get($options, 'data-remote')) { $formOptions['data-remote'] = array_pull($options, 'data-remote'); } + if (array_get($options, 'data-confirm')) { + $formOptions['data-confirm'] = array_pull($options, 'data-confirm'); + } $formOptions = array_merge($formOptions, array_pull($options, 'form', [])); return Form::open($formOptions).'
'.Form::submit($name, $options).'
'.Form::close();