Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. $this->primaryKey = 'isbn';
  2. return $this->hasMany('Other', 'isbn');
  3.  
  4. class Book {
  5. public function isbn() {
  6. // instead of hasMany
  7. return ISBN::where('isbn', $this->isbn);
  8. }
  9. }
  10.  
  11. public function getKeyName(){
  12. return $yourKeyName;
  13. }
  14.  
  15. return $this->hasMany('Comment', 'foreign_key', 'local_key');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement