2026-03-08 01:42:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
|
|
class StorePlatformAccountRequest extends FormRequest
|
|
|
|
|
{
|
|
|
|
|
public function authorize(): bool
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return array<string, string>
|
|
|
|
|
*/
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'platform' => 'required|in:lemmy',
|
2026-03-08 02:53:46 +01:00
|
|
|
'instance_domain' => 'required|string|max:255|regex:/^[a-zA-Z0-9]([a-zA-Z0-9\-\.]*[a-zA-Z0-9])?$/',
|
2026-03-08 01:42:21 +01:00
|
|
|
'username' => 'required|string|max:255',
|
|
|
|
|
'password' => 'required|string',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return array<string, string>
|
|
|
|
|
*/
|
|
|
|
|
public function messages(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
2026-03-08 02:53:46 +01:00
|
|
|
'instance_domain.regex' => 'Please enter a valid domain name (e.g., lemmy.world, belgae.social)',
|
2026-03-08 01:42:21 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|