class User extends Eloquent {
public function task()
{
return $this->hasOne('Task');
}
}
class Task extends Eloquent {
public function user()
{
return $this->belongsTo('User');
}
}
Task::with('user')->where('user_id', '=', $id)->get()