feat:improved background importing

This commit is contained in:
hackerESQ
2024-10-24 14:48:24 -05:00
parent 7543c0a865
commit 3c368310ad
15 changed files with 459 additions and 139 deletions
+3 -3
View File
@@ -69,10 +69,10 @@ class Portfolio extends Model
});
}
public function scopeFullAccess()
public function scopeFullAccess($query, $user_id = null)
{
return $this->whereHas('users', function ($query) {
$query->where('user_id', auth()->user()->id)
return $query->whereHas('users', function ($query) use ($user_id) {
$query->where('user_id', $user_id ?? auth()->user()->id)
->where(function ($query) {
$query->where('full_access', true)
->orWhere('owner', true);