Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Jdd Api Laravel Package

coredump/jdd-api

Laravel package exposing model resources via a simple JSON API and a Vue-friendly client: chain endpoints like $api.users[1].roleObject.users.array(), load rows/arrays, CRUD (post/put/delete), and call model methods with parameters.

View on GitHub
Deep Wiki
Context7

coredump/jdd-api

Project setup

composer require coredump/jdd-api

##Examples

Usage inside vue component

export default {
    mixins: [ window.ResourceMixin ],
    data() {
        return {
            // GET /api/data/users
            users: this.$api.users.array(), // load list of users in an array
            // GET /api/data/users/1
            user: this.$api.users[1].row(), // load row of user with id=1
            // GET /api/data/users/1/roleObject
            userRole: this.$api.users[1].roleObject.row(), // load row of user relationship "roleObject"
            // GET /api/data/users/1/roleObject/users
            userRoleUsers: this.$api.users[1].roleObject.users.array(), // load array of users of the same role of user 1
            // POST /api/data/users/1 {call:{method:'getNotifications'}, parameters: {...}}
            notifications: this.$api.users[1].arrayCall('getNotifications', {date: today}), // call method "getNotifications" from user 1 model and load its response into an array
            // POST /api/data/users/1 {call:{method:'evaluate'}, parameters: {...}}
            evaluation: this.$api.users[1].rowCall('evaluate', {date: today}), // call method "evaluate" from user 1 model and load its response into a row object
        };
    },
    methods: {
        evaluate(userId) {
            // Call a method "evaluate" from user model with id=1
            this.$api.users[userId].call('evaluate', {date: today}).then(response => {
                console.log('evaluate response: ', response);
            });
        },
        createUser(data = {attributes:{}}) {
            this.$api.users.post(data);
        },
        updateUser() {
            this.$api.users[1].put(this.user);
        },
        deleteUser() {
            this.$api.users[1].delete();
        },
    },
}
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor