update deploy
This commit is contained in:
51
app/Http/Requests/Lead/StoreLeadRequest.php
Normal file
51
app/Http/Requests/Lead/StoreLeadRequest.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Lead;
|
||||
|
||||
use App\Enums\LeadSource;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreLeadRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'phone' => ['required', 'string', 'max:20'],
|
||||
'email' => ['nullable', 'email', 'max:255'],
|
||||
'source' => ['required', 'string', Rule::enum(LeadSource::class)],
|
||||
'target_course' => ['nullable', 'string', 'max:255'],
|
||||
'education_level' => ['nullable', 'string', 'max:255'],
|
||||
'subject' => ['nullable', 'string', 'max:255'],
|
||||
'message' => ['nullable', 'string'],
|
||||
'kvkk_consent' => ['required', 'accepted'],
|
||||
'marketing_consent' => ['sometimes', 'boolean'],
|
||||
'utm_source' => ['nullable', 'string', 'max:255'],
|
||||
'utm_medium' => ['nullable', 'string', 'max:255'],
|
||||
'utm_campaign' => ['nullable', 'string', 'max:255'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Ad Soyad zorunludur.',
|
||||
'phone.required' => 'Telefon numarası zorunludur.',
|
||||
'source.required' => 'Kaynak bilgisi zorunludur.',
|
||||
'kvkk_consent.required' => 'KVKK onayı zorunludur.',
|
||||
'kvkk_consent.accepted' => 'KVKK metnini onaylamanız gerekmektedir.',
|
||||
];
|
||||
}
|
||||
}
|
||||
37
app/Http/Requests/Lead/UpdateLeadRequest.php
Normal file
37
app/Http/Requests/Lead/UpdateLeadRequest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Lead;
|
||||
|
||||
use App\Enums\LeadStatus;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateLeadRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'status' => ['sometimes', 'string', Rule::enum(LeadStatus::class)],
|
||||
'is_read' => ['sometimes', 'boolean'],
|
||||
'admin_note' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'status.in' => 'Geçersiz durum değeri.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user