<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h4 class="modal-title">Add consent</h4>
</div>
<div class="modal-body">
    <div class="portlet-body">


        {!! Form::open(['id'=>'createConsent','class'=>'ajax-form','method'=>'POST']) !!}
        <div class="form-body">
            <div class="row">
                <div class="col-xs-12 ">
                    <div class="form-group">
                        <label>Name</label>
                        <input type="text" name="name" class="form-control">
                    </div>
                </div>
                <div class="col-xs-12 ">
                    <div class="form-group">
                        <label>Description</label>
                        <textarea name="description" class="form-control"
                                  placeholder="Briefly describe the purpose on consent"></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-actions">
            <button type="button" id="save-consent" class="btn btn-success"><i
                        class="fa fa-check"></i> @lang('app.save')</button>
        </div>
        {!! Form::close() !!}
    </div>
</div>

<script>

    
    $('#save-consent').click(function () {
        $.easyAjax({
            url: '{{route('admin.gdpr.store-consent')}}',
            container: '#createConsent',
            type: "POST",
            data: $('#createConsent').serialize(),
            success: function (response) {
                if (response.status == 'success') {
                    window.location.reload();
                }
            }
        })
    });
</script>