update deploy
This commit is contained in:
41
app/Http/Requests/Preview/StorePreviewRequest.php
Normal file
41
app/Http/Requests/Preview/StorePreviewRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Preview;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StorePreviewRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'page_id' => ['required', 'integer', 'exists:pages,id'],
|
||||
'blocks' => ['present', 'array'],
|
||||
'blocks.*.type' => ['required', 'string', 'max:50'],
|
||||
'blocks.*.content' => ['present', 'array'],
|
||||
'blocks.*.order_index' => ['required', 'integer', 'min:0'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'page_id.required' => 'Sayfa ID zorunludur.',
|
||||
'page_id.exists' => 'Geçersiz sayfa.',
|
||||
'blocks.present' => 'Bloklar alanı gereklidir.',
|
||||
'blocks.*.type.required' => 'Blok tipi zorunludur.',
|
||||
'blocks.*.order_index.required' => 'Blok sırası zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user