Created
February 29, 2016 15:44
-
-
Save shibby/6f6b310c741ff0a30456 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Customer extends Eloquent { | |
protected $with = ['clients']; | |
public function clients() | |
{ | |
return $this->hasMany('Client'); | |
} | |
} | |
class Client extends Eloquent { | |
protected $with = ['customer']; | |
public function customer() | |
{ | |
return $this->belongsTo('Customer'); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
conversation: https://twitter.com/EmirKarsiyakali/status/704334241128120320