1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00
Files
openstamanager/resources/js/Models/Model.js
2021-10-08 13:07:18 +02:00

24 lines
549 B
JavaScript
Vendored

import {Model as BaseModel, PluralResponse} from 'coloquent';
import {snakeCase} from 'lodash-es';
export default class Model extends BaseModel {
/**
* Just an alias to the get() method
*/
static all(): Promise<PluralResponse<InstanceType<Model>>> {
return this.get();
}
getAttribute(attributeName: string): any {
return super.getAttribute(attributeName);
}
getJsonApiBaseUrl(): string {
return '/api';
}
getJsonApiType(): string {
return (super.getJsonApiType() ?? snakeCase(this.constructor.name));
}
}