mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
Filter out project users (#437)
This commit is contained in:
parent
c1ae58772c
commit
bfdf3533fd
@ -37,7 +37,15 @@ public function form(Form $form): Form
|
||||
->schema([
|
||||
Select::make('user')
|
||||
->name('user')
|
||||
->options(fn () => User::query()->pluck('name', 'id'))
|
||||
->options(fn () => User::query()
|
||||
->whereNotExists(function ($query) {
|
||||
$query->select('user_id')
|
||||
->from('user_project')
|
||||
->whereColumn('users.id', 'user_project.user_id')
|
||||
->where('user_project.project_id', $this->project->id);
|
||||
})
|
||||
->pluck('name', 'id')
|
||||
)
|
||||
->searchable()
|
||||
->rules(\App\Actions\Projects\AddUser::rules($this->project)['user']),
|
||||
])
|
||||
|
Loading…
x
Reference in New Issue
Block a user