Laravel-Me
A Javascript (Typescript
) package for make requests to laravel as simple as possible!
⚙️ Installation
Install the package by running
npm install laravel-me
Use it by importing the package wherever your want:
;
🎓 How it works
Our advise it's to create a new class that extends the Model
class, for example we can create a new User
class to handle the Laravel User Model.
;;
Now we can make create, read, update, or delete (CRUD) requests:
; ; ; ;
The log of this script will be something like:
1 - Create a new user
{
created_at: "2019-09-21 08:59:08"
email: "mauro@vlkstudio.com"
id: 9
name: "Mauro"
updated_at: "2019-09-21 08:59:08"
}
2 - Update the user
{
created_at: "2019-09-21 08:59:08"
email: "mauro@vlkstudio.com"
email_verified_at: null
id: 9
name: "Mauro Erta"
updated_at: "2019-09-21 08:59:08"
}
3 - Find the user
{
created_at: "2019-09-21 08:59:08"
email: "mauro@vlkstudio.com"
email_verified_at: null
id: 9
name: "Mauro Erta"
updated_at: "2019-09-21 08:59:08"
}
4 - Delete the user
{
message: "User successfully deleted"
}