update deploy
This commit is contained in:
41
app/Http/Requests/Faq/StoreFaqRequest.php
Normal file
41
app/Http/Requests/Faq/StoreFaqRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Faq;
|
||||
|
||||
use App\Enums\FaqCategory;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreFaqRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'question' => ['required', 'string', 'max:500'],
|
||||
'answer' => ['required', 'string'],
|
||||
'category' => ['required', 'string', Rule::enum(FaqCategory::class)],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'question.required' => 'Soru zorunludur.',
|
||||
'answer.required' => 'Cevap zorunludur.',
|
||||
'category.required' => 'Kategori zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Http/Requests/Faq/UpdateFaqRequest.php
Normal file
29
app/Http/Requests/Faq/UpdateFaqRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Faq;
|
||||
|
||||
use App\Enums\FaqCategory;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateFaqRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'question' => ['sometimes', 'string', 'max:500'],
|
||||
'answer' => ['sometimes', 'string'],
|
||||
'category' => ['sometimes', 'string', Rule::enum(FaqCategory::class)],
|
||||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||||
'is_active' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user