Commit workspace changes
This commit is contained in:
26
app/Http/Requests/Groups/StoreGroupMemberRequest.php
Normal file
26
app/Http/Requests/Groups/StoreGroupMemberRequest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Requests\Groups;
|
||||
|
||||
use App\Models\Group;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreGroupMemberRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user() !== null;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'username' => ['required', 'string', 'max:20'],
|
||||
'role' => ['required', 'in:' . implode(',', [Group::ROLE_ADMIN, Group::ROLE_EDITOR, Group::ROLE_MEMBER, Group::ROLE_CONTRIBUTOR])],
|
||||
'note' => ['nullable', 'string', 'max:500'],
|
||||
'expires_in_days' => ['nullable', 'integer', 'min:1', 'max:30'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user