in your user model you should add the relationship belongsTo (if the user belongs only to one company)
public function company(){
return belongsTo('company');
}
then you can get the id of the company like this
$user = User::find($id);
$company = $user->company;
$companyId = $company->id;
I hope this will be helpful