Skip to content

Optionally define Record relationships using methods #34

@hexus

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');
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions