Notice: Trying to get property 'id' of non-object code example
Example 1: trying to get property 'id' of non object in laravel api
$request->user()->id or Auth::user()->id or $request["user"]["id"]
Example 2: Notice: Trying to get property 'NAME' of non-object in
$user = $req->fetch(PDO::FETCH_OBJ);
if ($user && password_verify($_POST['password'], $user->password)) {