1

We are new to Laravel Spark, we are trying to add custom module in kiosk so we want one form in that module,we are following steps of below link https://spark.laravel.com/docs/2.0/forms

We are define our vue component for form in our ROOT_DIR/resources/assets/js/app.js by adding below code:

Vue.component('formexample', {
    data()
    {
        return {
            form: new SparkForm({
            level_name: '',
            level_status: ''
            })
        };
    }
});

After set the view file we add method to our vue component in app.js(ROOT_DIR/resources/assets/js/app.js) file:

 new Vue(require('laravel-spark'));
    Vue.component('formexample', {
        data()
        {
            return {
                form: new SparkForm({
                level_name: '',
                level_status: ''
                })
            };
        },
    methods: {
        register() {
            Spark.post('/formexample', this.form)
                .then(response => { console.log(response);
                });
            }
        }
    });

enter image description here

So our question is .we are follow the steps in wrong way ?? please suggest right way.

Also guide us for validation of forms and insert stuff into the database Thankx in advance

Vivek
  • 76
  • 6

0 Answers0