laravel-request-utils
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Laravel Request Utils Package

Installation

npm i laravel-request-utils

Usage

  1. Configure the request if needed.
// index.js
import { Request } from 'laravel-request-utils';

Request.setConfig({
    // Your config goes here.
});
  1. Create a new Form instance for Vue component.
<template>
    <form @submit.prevent="onSubmit">
        <input v-model="form.name" />
        <button type="submit">Submit</button>
    </form>
</template>

<script>
    import { Form } from 'laravel-request-utils';
    
    export default {
        name: 'MyFormComponent',
        data() {
            return {
                form: new Form({
                    name: '',
                }),
            }
        },
        methods: {
            onSubmit() {
                const url = '/your/api/endpoint';
                this.form.submit(url)
                  .then((data) => {
                    // Logic on successful submit.
                  });
            }
        }
    }
</script>

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.07latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.07
1.1.10
1.1.00
1.0.50
1.0.31
1.0.20
1.0.11
1.0.00
0.12.11
0.12.00
0.11.10
0.11.00
0.10.00
0.9.02
0.8.20
0.8.11
0.8.00
0.7.01
0.6.01
0.5.00
0.4.00
0.3.11
0.3.00
0.2.20
0.2.10
0.2.00
0.1.10
0.1.01
0.0.11

Package Sidebar

Install

npm i laravel-request-utils

Weekly Downloads

18

Version

2.0.0

License

MIT

Unpacked Size

32 kB

Total Files

26

Last publish

Collaborators

  • darkprinceww
  • faleks