Skip to content

Optionally define Record relationships using methods #34

Description

@hexus

Similar to the way Laravel does it, though this will bulk out the class even more.

class User extends Record
{
    public function roles() {
        return $this->belongsToMany('Role')->table('user_roles');
    }

    public function things() {
        return $this->hasMany('Thing')->foreignKey('owner_id');
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions