El error que me sale es el siguiente:
ErrorException: Trying to get property 'email' of non-object in file C:\xampp\htdocs\club\app\Http\Controllers\usuariosController.php on line 36
La función que tengo es la siguiente:
public function login(Request $request){
$response = ["status" =>0, "msg"=>""];
$data =json_decode($request->getContent());
$user = User::where('email', $data->email)->first();
if($user){
if(Hash::check($data->password, $user->password)){
$token = $user->createToken("example"); //token universal
$response["status"] = 1;
$response["msg"] = $token -> plainTextToken;
return redirect('privada');
}else{
$response["msg"] = "Credenciales incorrectas";
}
}else{
$response["msg"] = "Usuario no encontrado";
}
return response()->json($response);
}
$user = User::where('email', $data->email)->first();
dd($data);
para ver que te muesta???