Answer the question
In order to leave comments, you need to log in
Laravel validation not working, what could be the reason?
I made a separate class-request, in it I wrote
'order_id' => [
'required',
'integer',
Rule::exists('orders')->where(function ($query) {
$query->where('id', $this->order_id)->where('user_id', auth()->id());
}),
],
Answer the question
In order to leave comments, you need to log in
Rule::exists('orders', 'id')->where(function ($query) {
$query->where('user_id', auth()->id());
}),
$query->where('orders.id', $this->order_id)->where('orders.user_id', auth()->id());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question