mirror of
https://github.com/koel/koel
synced 2024-12-30 06:23:05 +00:00
31 lines
553 B
PHP
31 lines
553 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Requests\API;
|
||
|
|
||
|
/**
|
||
|
* @property-read array<string> $emails
|
||
|
*/
|
||
|
class InviteUserRequest extends Request
|
||
|
{
|
||
|
/**
|
||
|
* @return array<mixed>
|
||
|
*/
|
||
|
public function rules(): array
|
||
|
{
|
||
|
return [
|
||
|
'emails.*' => 'required|email|unique:users,email',
|
||
|
'is_admin' => 'sometimes',
|
||
|
];
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return array<mixed>
|
||
|
*/
|
||
|
public function messages(): array
|
||
|
{
|
||
|
return [
|
||
|
'emails.*.unique' => 'The email :input is already registered.',
|
||
|
];
|
||
|
}
|
||
|
}
|