Initial commit

This commit is contained in:
root
2026-05-09 17:28:23 +02:00
commit 9d73f82529
5575 changed files with 281989 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use App\Rules\GoogleRecaptchaRule;
use App\Rules\WebsiteWordfilterRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use RyanChandler\LaravelCloudflareTurnstile\Rules\Turnstile;
class AccountSettingsFormRequest extends FormRequest
{
public function rules(): array
{
$usernameRegex = setting('username_regex', '/^[a-zA-Z0-9_.-]+$/');
return [
'username' => ['sometimes', 'string', sprintf('regex:%s', $usernameRegex), 'min:3', 'max:25', Rule::unique('users')->ignore($this->user()->id), new WebsiteWordfilterRule],
'mail' => ['required', 'email', Rule::unique('users')->ignore($this->user()->id), new WebsiteWordfilterRule],
'motto' => ['nullable', 'string', 'max:127', new WebsiteWordfilterRule],
'g-recaptcha-response' => [new GoogleRecaptchaRule],
'cf-turnstile-response' => [app(Turnstile::class)],
];
}
public function authorize(): bool
{
return true;
}
}