You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the documentation describes I would check if the column date is unique with the column employee_id but I actually would need to check if data.attributes.date is unique with employee_id.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'data.attributes.date' in 'where clause' (SQL: select count(*) as aggregate from `employees` where `data`.`attributes`.`date` = 2017-08-25)
The text was updated successfully, but these errors were encountered:
I'm currently developing an API and the keys, of the incoming JSON data that have to be validated, do not match the actual database column names.
Incoming JSON for a POST request may look like this:
As the documentation describes I would check if the column
date
is unique with the columnemployee_id
but I actually would need to check ifdata.attributes.date
is unique withemployee_id
.So ...
'<field1>' => 'unique_with:<table>,<field2>[,<field3>,...,<ignore_rowid>]',
... would become ...
'data.attributes.date' => 'unique_with:<table>,employee_id',
Is there any chance that the
unique_with
validator could look like this: (?)'<custom_field_name>' => 'unique_with:<table>,<field1>,<field2>[,<field3>,...,<ignore_rowid>]',
Stacktrace:
The text was updated successfully, but these errors were encountered: