court’s judgment dismissing his 42 U.S.C. § 1983 action alleging civil rights violations related to his state court conviction for indecent exposure. We have jurisdiction under 28 U.S.C. § 1291. We review de novo. Beets v. County of Los Angeles, 669 F.3d 1038, 1041 (9th Cir.2012) (dismissal under Heck v. Humphrey, 512 U.S. 477, 114 S.Ct. 2364, 129 L.Ed.2d 383 (1994)); Hebbe v. Pliler, 627 F.3d 338, 341 (9th Cir.2010) (dismissal under Fed.R.Civ.P. 12(b)(6)). We affirm. The district court properly dismissed as Heck-barred Middleton’s claims against the Santa Barbara County defendants because success on his claims would necessarily imply the invalidity of his conviction, and Middleton failed to allege that his conviction has been invalidated. See Heck, 512 U.S. at 486-87, 114 S.Ct. 2364 (<HOLDING>). We do not consider the district court’s
holding that in order to recover damages for an allegedly unconstitutional conviction or imprisonment or for other harm caused by actions whose unlawfulness would render a conviction or sentence invalid a plaintiff must prove that the conviction or sentence has been reversed on direct appeal expunged by executive order declared invalid by a state tribunal authorized to make such determination or called into question by a federal courts issuance of a writ of habeas corpus holding that a claim for damages that would invalidate a conviction or sentence that has not already been invalidated or reversed on direct appeal by executive order by an authorized state tribunal or by a writ of habeas corpus is not cognizable under  1983 holding that a state prisoner must bring his claim in habeas only if by prevailing he would necessarily prove the unlawfulness of his conviction or confinement holding that a plaintiff requesting relief under  1983 had no cause of action unless and until the conviction or sentence is reversed expunged invalidated or impugned by the grant of a writ of habeas corpus holding that that if the success of a  1983 damages claim brought by a prisoner would necessarily imply the invalidity of his conviction or sentence the prisoner may only bring the claim where the conviction or sentence has been invalidated