mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 23:12:35 +00:00
Add phpstan level 7(#544)
This commit is contained in:
@ -11,6 +11,9 @@
|
||||
|
||||
class ProjectUsersList extends Widget
|
||||
{
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $listeners = ['userAdded' => '$refresh'];
|
||||
|
||||
public Project $project;
|
||||
@ -20,9 +23,12 @@ public function mount(Project $project): void
|
||||
$this->project = $project;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Builder<User>
|
||||
*/
|
||||
protected function getTableQuery(): Builder
|
||||
{
|
||||
return User::query()->whereHas('projects', function (Builder $query) {
|
||||
return User::query()->whereHas('projects', function (Builder $query): void {
|
||||
$query->where('project_id', $this->project->id);
|
||||
});
|
||||
}
|
||||
@ -46,10 +52,8 @@ public function table(Table $table): Table
|
||||
Tables\Actions\DeleteAction::make()
|
||||
->label('Remove')
|
||||
->modalHeading('Remove user from project')
|
||||
->visible(function ($record) {
|
||||
return $this->authorize('update', $this->project)->allowed() && $record->id !== auth()->id();
|
||||
})
|
||||
->using(function ($record) {
|
||||
->visible(fn ($record): bool => $this->authorize('update', $this->project)->allowed() && $record->id !== auth()->id())
|
||||
->using(function ($record): void {
|
||||
$this->project->users()->detach($record);
|
||||
}),
|
||||
])
|
||||
|
Reference in New Issue
Block a user