mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 02:11:36 +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([
|
->schema([
|
||||||
Select::make('user')
|
Select::make('user')
|
||||||
->name('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()
|
->searchable()
|
||||||
->rules(\App\Actions\Projects\AddUser::rules($this->project)['user']),
|
->rules(\App\Actions\Projects\AddUser::rules($this->project)['user']),
|
||||||
])
|
])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user