The legislature of this state at its session in 1891 passed the following act (Stats. 1891, p. 513): —
“The board of supervisors of the city and county of San Francisco are hereby authorized and directed to order paid to John J. Conlin, or his assigns or legal representatives, the sum of $54,015.37, said amount being the principal, together with all *20the interest thereon, that remains due and unpaid to the said John J. Conlin, on contracts entered into with the said John J. Conliu by the superintendent of streets of the said city and county, for work done upon the public streets of said city and county, and for material furnished for the improvement of the said public streets; for which work done and material furnished he has not been able to obtain compensation, according to the mode and procedure in such cases made and provided by statute, by reason of errors, omissions and irregularities of the municipal officers of the said city and county, in their official proceedings concerning such work and material furnished.”
Thereafter the plaintiff presented his demand for the said amount to the board of supervisors, and on the 7th of December, 1891, the board refused to allow or order the same paid, whereupon the plaintiff brought this proceeding in the superior court to obtain a mandate directing the defendants to allow the claim. The defendants filed an answer to the said complaint, in which they set forth certain matters alleged to be the basis of the action of the legislature in passing the act, and pleaded that by virtue thereof the act was in contravention of certain provisions of the constitution. The plaintiff demurred to this answer, but the court overruled his demurrer, and made findings of fact upon the issues presented by the answer, but in its conclusions of law held that the validity of the act must be determined from its face, and could not be made to depend upon matters of fact not appearing thereon.
In Stevenson v. Colgan, 91 Cal. 652; 25 Am. St. Rep. 230, we said that “in passing upon the constitutionality of a statute, the court must confine itself to a consideration of those matters which appear upon the face of the law, and those facts of which it can take judicial notice”; and the same principle was repeated in Bourn v. Hart, 93 Cal. 321; 27 Am. St. Rep. 203. The court in the present instance followed this rule in its conclusions of law, but its previous action in hearing evidence and making findings of fact, wherein it attempted to ascertain the “errors, omissions, and irregularities of municipal officers,” which in its findings it assumed to be “referred to in the act of the legislature of 1891,” was inconsistent therewith. It should have sustained the demurrer to the answer, and deter*21mined the plaintiff’s right of action without considering the facts therein alleged.
The authority of the legislature of a state to direct a municipality to make any payment of its funds rests upon the proposition that these moneys are public moneys acquired under the authority of the state for public purposes; that, as the municipality is created only as an auxiliary to the legislature for governmental purposes, with a jurisdiction confined to a limited portion of the state, it does not cease to be under the control of the legislature; and that the legislature has the same power of disposition over the public moneys in the custody of the municipality that it has over those in the state treasury. In making application of this principle, the legislature of this state prior to 1879 passed many acts of relief, in which public moneys were appropriated to individuals whose claims rested entirely upon some moral obligation which could not in every instance be formulated in convincing or satisfactory terms, and, when the constitutional convention met in that year, it placed a restriction upon such appropriations by the provision of section 31 of article IV. of the constitution, which declares that the legislature shall not have power “to make any gift, or authorize the making of any gift, of any public money, or thing of value, to any individual, municipal or other corporation whatever.” This prohibition is, however, primarily addressed to the legislature, and when an act of that body is brought before the judiciary for review, it is not to be assumed that the legislature has intentionally disregarded it, although if the act is in manifest violation of the foregoing section, it must be declared by the courts to be invalid. The provision, moreover, is not to receive a strict and narrow interpretation, but its spirit as well as its language is to be followed (People v. Hopkins, 55 N. Y. 81); and in determining whether a statute is in violation thereof, all the provisions of the statute, as well as those matters of which the court can take judicial knowledge, must be considered.
The “gift” which the legislature is prohibited from making is not limited ton mere voluntary transfer of personal property without consideration, which the Civil Code, section 1146, gives as the definition of a gift; but the term, as used in the constitution, includes all appropriations of public money for which there *22is no authority or enforcible claim, or which rest upon some moral or equitable obligation, which in the mind of a generous or even a just individual, dealing with his own moneys, might prompt him to recognize as worthy of some reward. The legislature is to be regarded as holding the public moneys in trust for public purposes, and this limitation of the constitution is directed against its disposal of these funds except in accordance with such purposes. All those moral considerations or demands resting merely upon some equitable consideration or idea of justice, which in an individual acting in his own right would be upheld, are insufficient as a basis for making an appropriation of public moneys. An appropriation of money by the legislature for the relief of one who has no legal claim therefor must be regarded as a gift within the meaning of that term, as used in this section, and it is none the less a gift that a sufficient motive appears for its appropriation, if the motive does not rest upon a valid consideration. In Stevenson v. Colgan, 91 Cal. 652; 25 Am. St. Rep. 230, we said: “By these provisions of the constitution there is denied to the legislature the right to make direct appropriations to individuals from general considerations of charity or gratitude, or because of some supposed moral obligation resting upon the people of the state, and such as a just and generous man, although under no legal liability so to do, might be willing to recognize in his dealings with others”; and we also said in Bourn v. Hart, 93 Cal. 321; 27 Am. St. Rep. 203: “A legislative appropriation made to an individual in payment of a claim for damages on account of personal injuries sustained by him while in its service, and for which the state is not responsible, either upon general principles of law, or by reason of some previous statute creating such liability, is a gift within the meaning of the constitution.”
The act under consideration purports to be for the “relief” of the plaintiff, and declares that the appropriation is made for the amount that remains due and unpaid upon certain contracts for which “ he has not been able to obtain compensation according to the mode and procedure in such cases made and provided by statute,” thus by its own terms showing that there was no legal obligation in favor of the plaintiff. The act also assigns the “ errors, omissions, and irregularities of municipal officers *23of said city and county in their official proceedings concerning such work and material furnished” as the reason why the plaintiff has not been able to obtain compensation for the work done by him, thus clearly pointing out the cause as well as the fact of there being no obligation in his favor.
As we take judicial notice of the statutes under which any improvements of streets in the city and county of San Francisco have been made, we know that each of the contracts under which the plaintiff did any work or furnished any material for the improvement of those streets contained an express condition that in no case would the city and county of San Francisco be liable for any portion of the expense of the said work or improvement, or for any delinquency of persons or property assessed. It thus appears that by the terms of the contracts referred to in the act as the basis of the plaintiff’s right to any compensation, he had expressly agreed to the exemption of the city and county of San Francisco from any liability thereunder, so that the effect of the statute would be to give him the amount of money therein specified to which, by his own agreement, he had waived all legal claim. This can be regarded in no other light than as a simple gift. We are aware that in Oreighton v. San Francisco, 42 Cal. 446, it was held that a similar provision in a contract did not prevent the legislature from directing the municipality to make payment to the contractor; but at that time there was no constitutional prohibition against any disposition whatsoever that the legislature might make of public moneys after they had been brought into the public treasury. It was for the very purpose of preventing such disposition that the provisions of the present constitution were inserted, and, consequently, the case of Creighton is of no authority in construing the present statute.
If the failure of the plaintiff to obtain compensation for the work done by him was by reason of any errors, omissions, and irregularities of the municipal officers which prevented them from having any jurisdiction to order the work done, or which rendered his contract invalid, these were matters which were open to the plaintiff, and could have been ascertained by him before entering into the contract; if, however, they arose subsequent to his entering into a valid contract, the statutes, by virtue of *24which the contract was made, gave him the right to have such errors, omissions, and irregularities corrected upon an appeal to the board of supervisors, and if he failed to seek redress in this mode his loss of compensation arose from his own neglect. In either case the act of the legislature is an attempt to appropriate 'public moneys for purposes for which there was no legal claim or obligation. The moral claim which, it is alleged, arose from the fact that the city had enjoyed the advantage of the work, is, as we have seen, insufficient to support the act. In IfoBean v. 8an Bernardino, 96 Cal. 183, a sewer had been constructed under a contract with the city of San Bernardino, which contained a clause exempting it from liability, similar to that in the contracts entered into by the plaintiff herein, and after the completion and acceptance of the sewer, the city passed a resolution authorizing the payment of a portion of the cost of its construction out of the funds of the municipality. In an action to recover this amount it was held that, inasmuch as by reason of this exemption there had never been any liability for the work on the part of the city, the resolution to pay the amount was without any consideration to support it, and that although the city had received the actual benefit of the work, this did not create even a moral obligation to pay for its cost. One of the reasons assigned for this conclusion was that cities are creatures of law, with powers defined by law, and that persons dealing with them are chargeable with notice, not only of the extent of their power, but also of the mode in which their power may be exercised. The principles declared in that case are controlling in this. The constitution makes the same inhibition on an appropriation of public moneys by the legislature without any consideration, that exists against a similar appropriation by a municipality. The legislature has no more right to direct a municipality to give away the public moneys in its treasury than had the municipality without such direction.
We hold, therefore, that the act in question violates the provisions of the foregoing section of the constitution, and is therefore invalid; and for this reason the judgment is reversed.
McFarland, J., Garoutte, J., Paterson, J., De Haven, J., and Beatty, C. J., concurred.
Rehearing denied.