Merge branch 'develop' into trunk
This commit is contained in:
commit
a3ebd56bfc
1 changed files with 4 additions and 1 deletions
|
|
@ -37,9 +37,12 @@ class StoreTicket extends FormRequest
|
|||
'exists:projects,id',
|
||||
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
function ($attribute, $value, $fail) {
|
||||
if (auth()->user()->role->equals(Role::admin())) {
|
||||
return;
|
||||
}
|
||||
if (!in_array($value, auth()->user()->projects()->pluck('id')->all())) {
|
||||
$fail(__('Veuillez choisir entre :values', [
|
||||
'value' => auth()->user()->projects()->pluck('name')->implode(',')
|
||||
'values' => auth()->user()->projects()->pluck('name')->implode(',')
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue