Lunacy Act 1845
The Lunacy/Lunatics Act 1845 (8 & 9 Vict., c. 100) and the County Asylums Act 1845 formed mental health law in England and Wales from 1845 to 1890. The Lunacy Act's most important provision was a change in the status of mentally ill people to patients.
Prior to the Lunacy Act, lunacy legislation in England was enshrined in the County Asylums Act of 1808, which established institutions for poor and for criminally-insane, mentally ill people. The institutions were called asylums and they gave refuge where mental illness could receive proper treatment. The first asylum owing to the County Asylums Act opened at Northampton in 1811. By 1827 however only nine county asylums had opened and many patients were still in gaol as prisoners and criminals. As a consequence of this slow progress the Lunacy Act 1845 created the Lunacy Commission to focus on lunacy legislation. The Act was championed by Anthony Ashley-Cooper, Seventh Earl of Shaftesbury.
Shaftesbury was the head of the Commission from its founding in 1845 until his death in 1885. The Lunacy Commission was made up of eleven Metropolitan Commissioners. The Commission was monumental as it was not only a full-time commission, but it was also salaried for six of its members. The six members of the commission that were full-time and salaried were made up of three members of the legal system and three members of the medical community. The other five members of the commission were all honorary members that simply had to attend board meetings. The duty of the Commission was to establish and carry out the provisions of the Act. 
The Act established the Commissioners in Lunacy to inspect plans for asylums on behalf of the Home Secretary (s.3). The Act required asylums, other than Bethlem Hospital, to be registered with the Commission, to have written regulations and to have a resident physician (s.42). Under the Act, patients lost their right of access to the courts to challenge their detention. Detention could only be reviewed by the commissioners or county visitors.
The Commission had many roles in carrying out the act. It established a network of public county institutions. It monitored the conditions in the asylums and the treatment of the patients. It made a point of reaching out to patients in workhouses and prisons and getting them to the proper institutions where they could be treated. It also focused on "single lunatics" who were not connected with any prisons or workhouse but needed psychiatric care. It monitored the treatment and mental condition of patients whom the Commission could not remove from prisons and workhouses.
1845 County Asylums Act
The Lunacy Act of 1845 was passed through Parliament simultaneously with the 1845 County Asylums Act. The two acts were dependent on each other. The Lunacy Act established the Lunacy Commission and the County Asylums Act set forth most of the provisions as to what was to be monitored within the asylums and helped establish the public network of the county asylums. Like the Lunacy Act, there had been several drafts of this act passed before 1845 and several afterward as well. The most notable of these were the 1808, and the 1853 County Asylum Acts. The Lunacy Act itself was amended several times after its conception. There was a new version written in both 1846 and 1847. Both of these versions were actually repealed by the 1853 County Asylums Act. 
The importance of these two acts together is that they consolidated Lunacy Law in England. However, no legislation has ever combined the entirety of Lunacy Law. Both of these acts were the basis for Lunacy Law in England until 1890 when both of them were repealed by the Lunacy Act of 1890.
Children and the Lunacy Act of 1845
When the Lunacy Act was passed in 1845, there were many questions raised about what to do with children in poor mental health. Insane children were more common than is commonly appreciated. The confusion arose because the Act gave no age limits on patients in the asylums. 
Some of the inspections conducted by the Lunacy Commission involved inspecting workhouses where the Commission would often find mentally unhealthy children and press for them to be removed. However, many of the asylums were hesitant to admit children. Because of this, some children were admitted under the guise that they were in urgent need of help and constituted a serious danger to themselves and others.
- Unsworth, Clive."Law and Lunacy in Psychiatry's 'Golden Age'", Oxford Journal of Legal Studies. Vol. 13, No. 4. (Winter, 1993), pp. 482.
- Unsworth, 1993, pp. 482.
- Wright, David: "Mental Health Timeline", 1999
- Wright, 1999
- The Lunacy Commission Archived 2007-06-24 at the Wayback Machine
- Adair, Forsythe, and Melling: "'A Proper Lunatic for Two Years': Pauper Lunatic Children in Victorian and Edwardian England. Child Admissions to the Devon County Asylum, 1845–1914", Journal of Social History, Vol. 31, No. 2. (Winter, 1997), pp. 371, doi:10.1353/jsh/31.2.371
- Adair, Forsythe, and Melling, 1997, pp.373