I want to ignore the slug if value is not changed. I am currently getting this error whenever i update the form.
This is my request on validation.
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
class ProductInsertFormRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; }
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'title'=>'required',
'regularPrice'=>'required',
'slug'=>'required|alpha_dash|min:5|max:255|unique:products,slug',
];
}
}