Reputation: 872
I want to check uniqueness of a slug + category field.
I want to cross check both the fields with database..
both fields belongs in the same table..
category could be 1 or 2.
table name is pages..
my validation code is something like this
$catid = \Request::input('category');
$this->validate($request, [
'title' => 'required',
'category' => 'required',
'slug' => "unique:pages|category,$catid",
'body' => 'required',
]);
i can't figure out what m i doing wrong? any suggestions will be helpful..
Upvotes: 2
Views: 395