I am trying to have this rules in my model
'Email' => 'email|unique:tablename,coloumntoignore,ignoreid',
The above rules is to check the unique coloumn except the id to be supplied in the ignoreid
I face two issues here
I am getting the user input
$DriverData = Input::except(array('_token'));
and sending it to the model
$validation = Validator::make($DriverData, DriverModel::$updaterules);
Note : This update is not the self so i can't get it by Auth::user()->id
and my primary key is not id
I check it by
'Email' => 'email|unique:driver_details,email,4',
It told me error
Column not found: 1054 Unknown column 'id' in 'where clause' (SQL: select count(*) as aggregate from `driver_details` where `email` = [email protected] and `id` <> 4)
though i mentioned the protected $primaryKey = 'DriverId';
So, How can i have get the value of the field inside the model so that i should check for the rule to check the unique coloumn except its one
Note : The dirty way like putting the DriverId in the session at controller and getting here like that is not preferred.