Advertisement
Guest User

Untitled

a guest
May 25th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1.     public function phones() {
  2.         return $this->belongToMany('Phone');    
  3.     }
  4.  
  5.     public function getPhonesAttribute() {
  6.         $phones= $this->phones()->getResults();
  7.         return $phones->each(function ($phone) {
  8.             $phone->_user = $this;
  9.         });
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement