src/Http/Form/Form.php
protected function buttons($fluent, Fieldset $fieldset)
    {
        $fieldset->control('button', 'cancel')
                ->field(function() {
                    return app('html')->link(handles("antares::notifications/"), trans('Cancel'), ['class' => 'btn btn--md btn--default mdl-button mdl-js-button']);
                });

        $acl = app('antares.acl')->make('antares/notifications');

        if ($acl->can('notifications-preview')) {
            $fieldset->control('button', 'preview')
                    ->attributes([
                        'type'       => 'button',
                        'value'      => trans('Preview'),
                        'class'      => 'btn btn-default notification-template-preview',
                        'url'        => handles('antares::notifications/preview/' . $fluent->id),
                        'data-title' => trans('antares/notifications::messages.generating_notification_preview')
                    ])
                    ->value(trans('Preview'));
        }

        if ($acl->can('notifications-test') && in_array($this->fluent->type, ['email', 'sms'])) {
            $fieldset->control('button', 'sendtest')
                    ->attributes([
                        'type'  => 'button',
                        'class' => 'btn btn-default send-test-notification',
                        'rel'   => handles('antares::notifications/sendtest', ['csrf' => true])
                    ])
                    ->value(trans('Send test'));
        }
        $fieldset->control('button', 'button')
                ->attributes(['type' => 'submit', 'class' => 'btn btn-primary'])
                ->value($fluent->id ? trans('antares/foundation::label.save_changes') : trans('Save'));
    }
protected function buttons($fluent, Fieldset $fieldset)
    {
        $fieldset->control('button', 'cancel')
                ->field(function() {
                    return app('html')->link(handles("antares::notifications/"), trans('Cancel'), ['class' => 'btn btn--md btn--default mdl-button mdl-js-button']);
                });

        $acl = app('antares.acl')->make('antares/notifications');

        if ($acl->can('notifications-preview')) {
            $fieldset->control('button', 'preview')
                    ->attributes([
                        'type'       => 'button',
                        'value'      => trans('Preview'),
                        'class'      => 'btn btn-default notification-template-preview',
                        'url'        => handles('antares::notifications/preview/' . $fluent->id),
                        'data-title' => trans('antares/notifications::messages.generating_notification_preview')
                    ])
                    ->value(trans('Preview'));
        }

        if ($acl->can('notifications-test') && in_array($this->fluent->type, ['email', 'sms'])) {
            $fieldset->control('button', 'sendtest')
                    ->attributes([
                        'type'  => 'button',
                        'class' => 'btn btn-default send-test-notification',
                        'rel'   => handles('antares::notifications/sendtest', ['csrf' => true])
                    ])
                    ->value(trans('Send test'));
        }
        $fieldset->control('button', 'button')
                ->attributes(['type' => 'submit', 'class' => 'btn btn-primary'])
                ->value($fluent->id ? trans('antares/foundation::label.save_changes') : trans('Save'));
    }
protected function buttons ( $ fluent , Fieldset $ fieldset ) { $ fieldset -> control ( 'button' , 'cancel' ) -> field ( function ( ) { return app ( 'html' ) -> link ( handles ( "antares::notifications/" ) , trans ( 'Cancel' ) , [ 'class' => 'btn btn--md btn--default mdl-button mdl-js-button' ] ) ; } ) ; $ acl = app ( 'antares.acl' ) -> make ( 'antares/notifications' ) ; if ( $ acl -> can ( 'notifications-preview' ) ) { $ fieldset -> control ( 'button' , 'preview' ) -> attributes ( [ 'type' => 'button' , 'value' => trans ( 'Preview' ) , 'class' => 'btn btn-default notification-template-preview' , 'url' => handles ( 'antares::notifications/preview/' . $ fluent -> id ) , 'data-title' => trans ( 'antares/notifications::messages.generating_notification_preview' ) ] ) -> value ( trans ( 'Preview' ) ) ; } if ( $ acl -> can ( 'notifications-test' ) && in_array ( $ this -> fluent -> type , [ 'email' , 'sms' ] ) ) { $ fieldset -> control ( 'button' , 'sendtest' ) -> attributes ( [ 'type' => 'button' , 'class' => 'btn btn-default send-test-notification' , 'rel' => handles ( 'antares::notifications/sendtest' , [ 'csrf' => true ] ) ] ) -> value ( trans ( 'Send test' ) ) ; } $ fieldset -> control ( 'button' , 'button' ) -> attributes ( [ 'type' => 'submit' , 'class' => 'btn btn-primary' ] ) -> value ( $ fluent -> id ? trans ( 'antares/foundation::label.save_changes' ) : trans ( 'Save' ) ) ; }
buttons in form

@param Fluent $fluent
@param Fieldset $fieldset
buttons in form