Skip to content

Relation isn't showing #8

@kealsera

Description

@kealsera

I wrote this condition:

{ "fillable": "id", "relation": [{ "name": "team", "fillable": "title" }]}

where my model is created like this:

QueryModel

 public $belongsTo = [
            'team' => [
                'Rikki\Heroeslounge\Models\Team',
                'key' => 'team_id',
                'otherKey' => 'id'
            ],
            'user' => ['RainLab\User\Models\User'],
            'role' => [
        'Rikki\Heroeslounge\Models\SlothRole'
        ]
        ];

Relation Model


  public $hasMany = [
            'sloths' => ['Rikki\Heroeslounge\Models\Sloth', 'order' => 'is_captain desc'],
            'apps' => ['Rikki\Heroeslounge\Models\Apps']
            ];

But the resulting query only shows null.

what am I doing wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions