I am unable to check whether following collection contains data or not
$users = \App\Tempuser::where('mobile','=',$request->mobile)->get();
if(isset($users))
return "ok";
else
return "failed";
but if there is nothing in $users
still i am not getting else part.
Use something like if ($users->count())
or if (count($users))
.