Commit 2d25882c authored by Vipul Basapati's avatar Vipul Basapati

Added update validation in BlogCategory

parent ae29e260
......@@ -3,16 +3,17 @@
namespace App\Http\Controllers\Backend\BlogCategories;
use App\Http\Controllers\Controller;
use App\Http\Responses\ViewResponse;
use App\Http\Responses\RedirectResponse;
use App\Models\BlogCategories\BlogCategory;
use App\Http\Responses\Backend\BlogCategory\EditResponse;
use App\Repositories\Backend\BlogCategories\BlogCategoriesRepository;
use App\Http\Requests\Backend\BlogCategories\EditBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\StoreBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\CreateBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\DeleteBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\EditBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\ManageBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\StoreBlogCategoriesRequest;
use App\Http\Requests\Backend\BlogCategories\UpdateBlogCategoriesRequest;
use App\Http\Responses\RedirectResponse;
use App\Http\Responses\ViewResponse;
use App\Models\BlogCategories\BlogCategory;
use App\Repositories\Backend\BlogCategories\BlogCategoriesRepository;
/**
* Class BlogCategoriesController.
......
......@@ -27,7 +27,7 @@ class UpdateBlogCategoriesRequest extends Request
public function rules()
{
return [
'name' => 'required|max:191',
'name' => 'required|max:191|unique:blog_categories,name,' . $this->segment(3)
];
}
......@@ -39,6 +39,7 @@ class UpdateBlogCategoriesRequest extends Request
public function messages()
{
return [
'name.unique' => 'Blog category name already exists, please enter a different name.',
'name.required' => 'Blog category name must required',
'name.max' => 'Blog category may not be greater than 191 characters.',
];
......
<?php
namespace App\Http\Responses\Backend\Menu;
namespace App\Http\Responses\Backend\BlogCategory;
use Illuminate\Contracts\Support\Responsable;
......@@ -14,7 +14,7 @@ class EditResponse implements Responsable
/**
* @param \App\Models\BlogCategories\BlogCategory $blogCategory
*/
public function __construct($blogCategory, $types, $modules)
public function __construct($blogCategory)
{
$this->blogCategory = $blogCategory;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment