topclaudy / compoships

Multi-columns relationships for Laravel's Eloquent ORM
MIT License
1.12k stars 132 forks source link

I cannot understand the examples. #78

Closed JunaidQadirB closed 4 years ago

JunaidQadirB commented 4 years ago

Forgive my ignorance, I can't make sense of the examples given in the readme.

 public function b()
    {
        return $this->hasMany('B', ['f1', 'f2'], ['l1', 'l2']);
    }

It would be great if real-life examples are used to convey the usage properly so that everyone can understand them easily.

Thanks,

topclaudy commented 4 years ago

Good point! I will update the doc in the upcoming days...

topclaudy commented 4 years ago

@JunaidQadirB Meanwhile, you may take a look at the examples from the tests https://github.com/topclaudy/compoships/blob/master/tests/ComposhipsTest.php

JunaidQadirB commented 4 years ago

Thanks. I'll check

topclaudy commented 4 years ago

The documentation has been updated to include a real-life scenario.