Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->primaryKey = 'isbn';
- return $this->hasMany('Other', 'isbn');
- class Book {
- public function isbn() {
- // instead of hasMany
- return ISBN::where('isbn', $this->isbn);
- }
- }
- public function getKeyName(){
- return $yourKeyName;
- }
- return $this->hasMany('Comment', 'foreign_key', 'local_key');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement