J
J
javanub2015-11-19 17:51:00
Laravel
javanub, 2015-11-19 17:51:00

How to check if the passed user_id exists in middleware?

How to check if the passed user_id exists in middleware?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mokhirjon Naimov, 2015-11-21
@javanub

if ($request->has('user_id'))
{
    // Yes
}
else
{
    // No
}

G
Gregory, 2015-11-20
@difiso

Check in the handle method .
Options:
In general, it is in the documentation and in large quantities .

J
javanub, 2015-11-24
@javanub

$user = User::find($id);
if(is_null(...))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question