# vue-form-helper

> A small package for handling form operations with Vue.js that easily integrate into Laravel projects. This is a slightly modified version of Jeffrey Way's lesson on Object Oriented Forms in Vue.js with more updates to come.

Latest version **1.0.0** (published 2017-06-07) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install vue-form-helper
pnpm add vue-form-helper
yarn add vue-form-helper
bun add vue-form-helper
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-06-07 |
| First published | 2017-06-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | andyleach |

## Links

- npm: https://www.npmjs.com/package/vue-form-helper
- npm.io page: https://npm.io/package/vue-form-helper

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.16.2

## Recent versions

- 1.0.0 (latest) — 2017-06-07

## README

# Vue-Form-Helper
<p>
Heavily based upon the work by Jeffrey Way at Laracasts, and exists mainly to provide me a easy way to use what was taught in a lesson by him. If you are interested in learning more about the lesson this package is based upon you may view it in his <strong><a href="https://laracasts.com/series/learn-vue-2-step-by-step/episodes/19
">Object-Oriented Forms lesson</a></strong>. I highly recommend anyone interested in Vue or Laravel subscribe to Laracasts, it's the best $9 a month you can spend.
</p>

## Setup
<p>
This package uses the $http prototype for Vuejs which means that it can work with any Ajax library you desire.  A basic setup using axios and Laravel would be handled doing the following:
</p>

```javascript
/**
 * Vue is a modern JavaScript library for building interactive web interfaces
 * using reactive data binding and reusable components. Vue's API is clean
 * and simple, leaving you to focus on building your next great project.
 */
window.Vue = require('vue/dist/vue.js');

/**
 * We'll load the axios HTTP library which allows us to easily issue requests
 * to our Laravel back-end. This library automatically handles sending the
 * CSRF token as a header based on the value of the "XSRF" token cookie.
 */

window.axios = require('axios');

window.axios.defaults.headers.common = {
    'X-CSRF-TOKEN': window.Laravel.csrfToken,
    'X-Requested-With': 'XMLHttpRequest'
};

Vue.prototype.$http = axios;
```

## Example Usage
```javascript
new Vue({
    el: '#app',

    data: {
        form: new Form({
            name: '',
            description: ''
        })
    },

    methods: {
        onSubmit() {
            this.form.post('/projects')
                .then(response => alert('Wahoo!'));
        }
    }
});
```

---
_Source: https://npm.io/package/vue-form-helper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
