O
O
onlinejunior2020-07-12 18:12:48
Laravel
onlinejunior, 2020-07-12 18:12:48

How in laravel to check if the selected list belongs to the user?

I need to validate the entered data by id.

The problem is that there is no sport column in the table:

'sport' => Rule::exists('sport_info')->where(function ($query) {
                return $query->where('user_id', Auth::id());


How can I override sport in ID without touching the name field in the form?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question