Add supplier linking
This commit is contained in:
@@ -161,6 +161,13 @@ class User extends Authenticatable implements IDs
|
||||
->active();
|
||||
}
|
||||
|
||||
public function suppliers()
|
||||
{
|
||||
return $this->belongsToMany(Supplier::class)
|
||||
->where('supplier_user.site_id',$this->site_id)
|
||||
->withPivot('id','created_at');
|
||||
}
|
||||
|
||||
/* ATTRIBUTES */
|
||||
|
||||
/**
|
||||
@@ -231,7 +238,7 @@ class User extends Authenticatable implements IDs
|
||||
});
|
||||
|
||||
} elseif (is_numeric($term)) {
|
||||
$query->where('id','like','%'.$term.'%');
|
||||
$query->where('users.id','like','%'.$term.'%');
|
||||
|
||||
} elseif (preg_match('/\@/',$term)) {
|
||||
$query->where('email','like','%'.$term.'%');
|
||||
|
Reference in New Issue
Block a user