Vue.js Model system based on Laravel Models and Queries.
npm install @bobanum/vue-model
In your project, create a file named vue-model.js
in the root directory and add the following code:
import { Model as ModelBase } from '@bobanum/vue-model';
export default class Model extends ModelBase {
static get baseUrl() {
return "http://localhost:8000/api";
}
}
import Vue from 'vue'
import {Model} from '@bobanum/vue-model'
export default class Task extends Model {
static get url () {
return '/api/model'
}
static get fields () {
return {
id: {
type: Number,
default: null
},
name: {
type: String,
default: null
}
}
}
}
Method | Verb | URL | Description |
---|---|---|---|
Model.all() |
GET | /api/task |
gets all rows |
To be continued