-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using dot in column keys #72
Comments
@webysther Please help test out #73 and give feedback if possible. It is based on version 3.0.0, so you need to upgrade (Usually only thing necessary is to update the service provider class in your |
Hi @felixkiss works partially, the problem of SQL is fine, but now search works but dont check all columns, example: For rule: unique_with:search_filters,search.name = name, search.user_id = user_id Return the message:
And the SQL executed is by validation: select count(*) as aggregate from `search_filters` where `name` = 'teste' My create statment: CREATE TABLE `search_filters` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`name` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`filter` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_by` int(10) unsigned DEFAULT NULL,
`updated_by` int(10) unsigned DEFAULT NULL,
`deleted_by` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_search_filters` (`user_id`,`name`,`deleted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Rows in table:
|
@felixkiss maybe is related to laravel/framework#1820 |
I just tried it myself. I had the exact same problem as you until I noticed that I wasn't using the
|
As for the $data = [
'search' => [
'name' => 'foo',
'user_id' => 2,
],
'deleted_at' => '0000-00-00 00:00:00',
];
$rules = [
'search.name' => 'required|unique_with:search_filters, search.name = name, search.user_id = user_id, deleted_at',
'search.user_id' => 'required',
];
$validator = Validator::make($data, $rules); |
Now works! 👍 |
SQL fail using 'channel.name' as column. 'channel.name' is a HTML form with format
channel[name]
:The text was updated successfully, but these errors were encountered: