From d687afbe73e5a04c6b2125a508a0902dc22dcf55 Mon Sep 17 00:00:00 2001 From: Maicol Battistini Date: Sat, 18 Dec 2021 13:23:33 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20Aggiunti=20alias=20per=20al?= =?UTF-8?q?cuni=20metodi=20del=20Model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/js/Models/Model.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/resources/js/Models/Model.js b/resources/js/Models/Model.js index eddb7b47c..ec1ce1dd8 100644 --- a/resources/js/Models/Model.js +++ b/resources/js/Models/Model.js @@ -9,7 +9,9 @@ import {snakeCase} from 'lodash-es'; */ export default class Model extends BaseModel { /** - * Just an alias to the get() method + * Just an alias to the get() method. + * + * Returns all the instances of the model. */ static all(): Promise>> { return this.get(); @@ -21,6 +23,18 @@ export default class Model extends BaseModel { } } + getAttribute(attributeName: string): any { + return super.getAttribute(attributeName); + } + + setAttribute(attributeName: string, value: any) { + super.setAttribute(attributeName, value); + } + + getAttributes(): { [p: string]: any } { + return super.getAttributes(); + } + getJsonApiBaseUrl(): string { return '/api'; }