Validator Class Has Been Removed
This commit is contained in:
parent
bf9663a2a4
commit
f0b532a676
|
|
@ -81,7 +81,7 @@ class CategoryController extends Controller
|
|||
public function store()
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'slug' => ['required', 'unique:category_translations,slug', new \Webkul\Core\Contracts\Validations\Slug],
|
||||
'slug' => ['required', 'unique:category_translations,slug'],
|
||||
'name' => 'required',
|
||||
'image.*' => 'mimes:bmp,jpeg,jpg,png,webp',
|
||||
'description' => 'required_if:display_mode,==,description_only,products_and_description',
|
||||
|
|
@ -122,7 +122,7 @@ class CategoryController extends Controller
|
|||
$locale = request()->get('locale') ?: app()->getLocale();
|
||||
|
||||
$this->validate(request(), [
|
||||
$locale . '.slug' => ['required', new \Webkul\Core\Contracts\Validations\Slug, function ($attribute, $value, $fail) use ($id) {
|
||||
$locale . '.slug' => ['required', function ($attribute, $value, $fail) use ($id) {
|
||||
if (! $this->categoryRepository->isSlugUnique($id, $value)) {
|
||||
$fail(trans('admin::app.response.already-taken', ['name' => 'Category']));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue