I have a table
Leadsheet
---leadcode
Deal
-- leadcode(foreign key)
Now the model for leadsheet is as follow
class leadsheet extends Model
{
protected $table = 'leadsheet';
/**
* Get the callbacks for the blog post.
*/
public function callback()
{
return $this->hasMany('App\callback');
}
public function Deal()
{
return $this->hasOne('App\Deal','leadcode', 'leadcode');
}
}
I want to get only those lead that have deals in deal table , Using Eloquent
Thanks
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire