Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function phones() {
- return $this->belongToMany('Phone');
- }
- public function getPhonesAttribute() {
- $phones= $this->phones()->getResults();
- return $phones->each(function ($phone) {
- $phone->_user = $this;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement