global storage-providers, notification channels and server providers (#247)

This commit is contained in:
Saeed Vaziry
2024-06-29 12:52:03 +03:30
committed by GitHub
parent ad027eb033
commit 11e3b167cc
44 changed files with 678 additions and 77 deletions

View File

@ -3,7 +3,7 @@
namespace App\Models;
use App\SourceControlProviders\SourceControlProvider;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
@ -57,10 +57,10 @@ public function project(): BelongsTo
return $this->belongsTo(Project::class);
}
public static function getByCurrentProject(): Collection
public static function getByProjectId(int $projectId): Builder
{
return self::query()
->where('project_id', auth()->user()->current_project_id)
->orWhereNull('project_id')->get();
->where('project_id', $projectId)
->orWhereNull('project_id');
}
}