In an action for money had and received, the plaintiff appeals from an order of the Supreme Court, Westchester County (Palella, J.), entered February 24, 1987, which denied his motion for summary judgment and granted the defendant’s cross motion to dismiss the action as barred by the Statute of Limitations.
Ordered that the order is reversed, on the law, the plaintiff’s motion is granted and the defendant’s cross motion is denied, with costs; and it is further,
Ordered that this action is converted into an action for a judgment declaring the invalidity of so much of Local Laws, 1982, No. 6 of the Town of Yorktown as requires payment of a recreation fee in lieu of land as a condition of site plan approval, and it is declared that this portion of Local Laws, 1982, No. 6 of the Town of Yorktown is invalid and that the plaintiff is entitled to a refund of moneys so paid, with interest thereon from May 29, 1986; and it is further,
Ordered that the matter is remitted to the Supreme Court, Westchester County, for entry of an appropriate judgment in accordance herewith.
On October 1, 1985, the Town Board of the Town of Yorktown granted the plaintiff’s application for site plan approval for a proposed multifamily cluster development conditioned, inter alia, upon the payment of a recreation fee in the amount *608of $47,550. On May 29, 1986, the plaintiff paid the fee under protest, and thereafter, on September 2, 1986, commenced this action for money had and received. Subsequently, the plaintiff moved for summary judgment and the defendant cross-moved to dismiss. The Supreme Court denied the plaintiff’s motion and granted the defendant’s cross motion to dismiss the action holding that an action for money had and received was an inappropriate vehicle to review a determination by the Town Board for site plan approval, and that the challenge to the Board’s action should have been brought as a CPLR article 78 proceeding which, on the facts of the case, was time barred. We reverse.
The gravamen of the plaintiff’s challenge here is not that the action of the Town Board was in excess of its authority under Local Laws, 1982, No. 6, which, inter alia, permits the imposition of a recreation fee as a condition of a site plan approval, but rather that the local law itself is an invalid legislative enactment which is in excess of the authority delegated to town boards by Town Law § 274-a. It is well established that an article 78 proceeding is not the proper vehicle to test the validity of a legislative enactment (see, Solnick v Whalen, 49 NY2d 224; Matter of Kovarsky v Housing & Dev. Admin., 31 NY2d 184) as opposed to an administrative determination under that enactment.
The Supreme Court’s reference in its decision to the fact that Riegert Apts. Corp. v Planning Bd. (57 NY2d 206), the case upon which the plaintiff bases his substantive arguments, was itself a CPLR article 78 proceeding, is misplaced. Riegert concerned a challenge to a similar condition placed upon a site plan approval under the authority of Town Law § 274-a itself. It was not a challenge to the validity of that section of the law, but to the defendant planning board’s authority to impose such a condition under that law. In the case at bar, we are concerned with the validity of the local law which specifically authorized the imposition of the condition.
As to the form of pleading taken by the plaintiff, i.e., an action for money had and received, we would note that one court has found such an action to be the proper vehicle to consider the validity of a local law which imposed a condition of payment of money in lieu of land on the development of property (see, Jenad, Inc. v Village of Scarsdale, 35 Misc 2d 450). We are also cognizant of case law authorizing the use of an action for money had and received to recover taxes which have been collected in violation of constitutional authority (see, Matter of Trizec W. v City of New York, 66 NY2d 807). *609We conclude, however, that a declaratory judgment action is the more appropriate vehicle to attack the action of the Town Board in this case and under the broad powers conferred by CPLR 103 (c) to correct an action improperly brought and where, as here, all the parties are properly before the court, we convert the action into one for a declaratory judgment (see, Matter of Kovarsky v Housing & Dev. Admin., supra). Further, we conclude that since an article 78 proceeding was not a proper vehicle for challenging the legitimacy of the local law, the shorter Statute of Limitations (CPLR 217) was equally inapplicable. The six-year Statute of Limitations applicable to declaratory judgment actions should have been applied (CPLR 213) and, accordingly, it was error to dismiss the action as time barred.
As respects the merits of the substantive issue raised, the defendant contends that the authority for imposition of the recreation fee may be found in the provisions of Local Laws, 1982, No. 6 of the Town of Yorktown which, in turn, is allegedly authorized by the provisions of Municipal Home Rule Law § 10. Section 10 grants every local government the power to adopt and amend local laws relating to its property provided that they are not inconsistent with the provisions of the Constitution or of any general law (Municipal Home Rule Law § 10 [1] [i], [ii] [d] [3]).
The power of local governments to enact legislation governing land use is circumscribed by the Legislature. As the Court of Appeals has stated: "Towns and other municipal authorities have no inherent power to enact or enforce zoning or land use regulations. They exercise such authority solely by legislative grant and in the absence of legislative delegation of power their actions are ultra vires and void” (Matter of Kamhi v Planning Bd., 59 NY2d 385, 389). A local law may be struck down as inconsistent with State law if it is found that the local law permits an action specifically prohibited by the State law (Council for Owner Occupied Hous. v Koch, 119 Misc 2d 241, affd 61 NY2d 942). In Riegert Apts. Corp. v Planning Bd. (supra), the Court of Appeals specifically held that although a town may require that before approving a subdivision plan, either land or money in lieu of land be delivered to the municipality for developing parks (see, Town Law §§ 276, 277), no such condition may be imposed on approval of a site plan. Thus, the provisions of Local Law No. 6, which specifically purport to authorize the imposition of such a condition, are in direct contravention of this holding and may not stand. Accordingly, since the condition imposed upon the approval of *610the plaintiffs site plan was predicated upon an invalid legislative act, it must fall, and the plaintiff is entitled to recover his money. Thompson, J. P., Brown, Weinstein and Harwood, JJ., concur.