I'm working on a ERP using laravel 5.2 I need to do this:
When the user tries to create a new bank, the program will perform a validation to check that the given business name and the given ABI code are unique. When the validation will be executed, the program will ignore all those records with value of 1 on deleted column, for both business name and ABI.
The problem is that it's completely ignoring my where clause. This is the validation rule:
$this->validate($request, [
'business_name' => 'required|max:255|unique:banks,deleted,0',
'abi' => 'required|max:5|min:5|unique:banks,deleted,0'
]);
The columns in the banks table are:
- id
- business_name
- abi
- disabled
- deleted
- // laravel timestamps
If i didn't misunderstood the documentation for Laravel 5.2 this is the correct way to set a where clause in a unique filter...?
Every kind of help will be appreciated!