src/Widgets/NotificationSender/Form/NotificationWidgetForm.php
public function get()
    {
        $this->scripts();
        return app('antares.form')->of("antares.widgets: notification-widget")->extend(function (FormGrid $form) {

                    $form->name('Notification Tester');
                    $form->simple(handles('antares::notifications/widgets/send'), ['id' => 'notification-widget-form']);

                    $form->layout('antares/notifications::widgets.forms.send_notification_form');

                    $form->fieldset(trans('Default Fieldset'), function (Fieldset $fieldset) {

                        $fieldset->control('input:hidden', 'url')
                                ->attributes(['class' => 'notification-widget-url'])
                                ->value(handles('antares::notifications/notifications'))
                                ->block(['class' => 'hidden']);

                        $fieldset->control('select', 'type')
                                ->attributes(['class' => 'notification-widget-change-type-select', 'url' => handles('antares::notifications/notifications')])
                                ->options($this->repository->getDecoratedNotificationTypes())
                                ->wrapper(['class' => 'w200']);

                        $fieldset->control('select', 'notifications')
                                ->attributes(['class' => 'notification-widget-notifications-select'])
                                ->options($this->repository->getNotificationContents('email')->pluck('title', 'id'))
                                ->wrapper(['class' => 'w300']);

                        if (!is_null(from_route('user'))) {
                            $fieldset->control('button', 'send')
                                    ->attributes([
                                        'type'       => 'submit',
                                        'class'      => 'notification-widget-send-button',
                                        'data-title' => trans('Are you sure to send notification?'),
                                        'url'        => handles('antares::notifications/widgets/send'),
                                    ])->value(trans('Send'));
                        }
                        $fieldset->control('button', 'test')
                                ->attributes([
                                    'type'       => 'submit',
                                    'class'      => 'notification-widget-test-button btn--red',
                                    'data-title' => trans('Are you sure to test notification?'),
                                    'url'        => handles('antares::notifications/widgets/test'),
                                ])->value(trans('Test'));
                    });
                    $form->rules($this->rules);
                    $form->ajaxable([
                        'afterValidate' => $this->afterValidateInline()
                    ]);
                });
    }
public function get()
    {
        $this->scripts();
        return app('antares.form')->of("antares.widgets: notification-widget")->extend(function (FormGrid $form) {

                    $form->name('Notification Tester');
                    $form->simple(handles('antares::notifications/widgets/send'), ['id' => 'notification-widget-form']);

                    $form->layout('antares/notifications::widgets.forms.send_notification_form');

                    $form->fieldset(trans('Default Fieldset'), function (Fieldset $fieldset) {

                        $fieldset->control('input:hidden', 'url')
                                ->attributes(['class' => 'notification-widget-url'])
                                ->value(handles('antares::notifications/notifications'))
                                ->block(['class' => 'hidden']);

                        $fieldset->control('select', 'type')
                                ->attributes(['class' => 'notification-widget-change-type-select', 'url' => handles('antares::notifications/notifications')])
                                ->options($this->repository->getDecoratedNotificationTypes())
                                ->wrapper(['class' => 'w200']);

                        $fieldset->control('select', 'notifications')
                                ->attributes(['class' => 'notification-widget-notifications-select'])
                                ->options($this->repository->getNotificationContents('email')->pluck('title', 'id'))
                                ->wrapper(['class' => 'w300']);

                        if (!is_null(from_route('user'))) {
                            $fieldset->control('button', 'send')
                                    ->attributes([
                                        'type'       => 'submit',
                                        'class'      => 'notification-widget-send-button',
                                        'data-title' => trans('Are you sure to send notification?'),
                                        'url'        => handles('antares::notifications/widgets/send'),
                                    ])->value(trans('Send'));
                        }
                        $fieldset->control('button', 'test')
                                ->attributes([
                                    'type'       => 'submit',
                                    'class'      => 'notification-widget-test-button btn--red',
                                    'data-title' => trans('Are you sure to test notification?'),
                                    'url'        => handles('antares::notifications/widgets/test'),
                                ])->value(trans('Test'));
                    });
                    $form->rules($this->rules);
                    $form->ajaxable([
                        'afterValidate' => $this->afterValidateInline()
                    ]);
                });
    }
public function get ( ) { $ this -> scripts ( ) ; return app ( 'antares.form' ) -> of ( "antares.widgets: notification-widget" ) -> extend ( function ( FormGrid $ form ) { $ form -> name ( 'Notification Tester' ) ; $ form -> simple ( handles ( 'antares::notifications/widgets/send' ) , [ 'id' => 'notification-widget-form' ] ) ; $ form -> layout ( 'antares/notifications::widgets.forms.send_notification_form' ) ; $ form -> fieldset ( trans ( 'Default Fieldset' ) , function ( Fieldset $ fieldset ) { $ fieldset -> control ( 'input:hidden' , 'url' ) -> attributes ( [ 'class' => 'notification-widget-url' ] ) -> value ( handles ( 'antares::notifications/notifications' ) ) -> block ( [ 'class' => 'hidden' ] ) ; $ fieldset -> control ( 'select' , 'type' ) -> attributes ( [ 'class' => 'notification-widget-change-type-select' , 'url' => handles ( 'antares::notifications/notifications' ) ] ) -> options ( $ this -> repository -> getDecoratedNotificationTypes ( ) ) -> wrapper ( [ 'class' => 'w200' ] ) ; $ fieldset -> control ( 'select' , 'notifications' ) -> attributes ( [ 'class' => 'notification-widget-notifications-select' ] ) -> options ( $ this -> repository -> getNotificationContents ( 'email' ) -> pluck ( 'title' , 'id' ) ) -> wrapper ( [ 'class' => 'w300' ] ) ; if ( ! is_null ( from_route ( 'user' ) ) ) { $ fieldset -> control ( 'button' , 'send' ) -> attributes ( [ 'type' => 'submit' , 'class' => 'notification-widget-send-button' , 'data-title' => trans ( 'Are you sure to send notification?' ) , 'url' => handles ( 'antares::notifications/widgets/send' ) , ] ) -> value ( trans ( 'Send' ) ) ; } $ fieldset -> control ( 'button' , 'test' ) -> attributes ( [ 'type' => 'submit' , 'class' => 'notification-widget-test-button btn--red' , 'data-title' => trans ( 'Are you sure to test notification?' ) , 'url' => handles ( 'antares::notifications/widgets/test' ) , ] ) -> value ( trans ( 'Test' ) ) ; } ) ; $ form -> rules ( $ this -> rules ) ; $ form -> ajaxable ( [ 'afterValidate' => $ this -> afterValidateInline ( ) ] ) ; } ) ; }
Gets form instance

@return \Antares\Html\Form\FormBuilder
Gets form instance