update deploy
This commit is contained in:
41
app/Http/Requests/Category/UpdateCategoryRequest.php
Normal file
41
app/Http/Requests/Category/UpdateCategoryRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Category;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateCategoryRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, mixed>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'slug' => ['required', 'string', 'max:255', Rule::unique('categories', 'slug')->ignore($this->route('category'))],
|
||||
'label' => ['required', 'string', 'max:255'],
|
||||
'desc' => ['nullable', 'string'],
|
||||
'image' => ['nullable', 'string', 'max:255'],
|
||||
'meta_title' => ['nullable', 'string', 'max:255'],
|
||||
'meta_description' => ['nullable', 'string'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'slug.required' => 'Slug alanı zorunludur.',
|
||||
'slug.unique' => 'Bu slug zaten kullanılıyor.',
|
||||
'label.required' => 'Kategori adı zorunludur.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user