Skip to content

Instantly share code, notes, and snippets.

@shibby
Created February 29, 2016 15:44
Show Gist options
  • Save shibby/6f6b310c741ff0a30456 to your computer and use it in GitHub Desktop.
Save shibby/6f6b310c741ff0a30456 to your computer and use it in GitHub Desktop.
<?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');
}
}
@shibby
Copy link
Author

shibby commented Feb 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment