This question is similar, but only talks about guns. I don't mean a laser that is going to destroy the plane, but why aren't rear-mounted, rear-firing lasers that can blind a pilot a thing? Most of the concerns about weight and relative velocities from the other question disappear with a lighter-weight laser that is firing light.
Such weapons are not used by countries that abide by the Geneva Convention:
It is prohibited to employ laser weapons specifically designed, as their sole combat function or as one of their combat functions, to cause permanent blindness to unenhanced vision, that is to the naked eye or to the eye with corrective eyesight devices.
For the U.S.A., page 45 of Navy Shipboard Lasers for Surface, Air, and Missile Defense says:
Besides the other answers, international law and the technical complexity of putting a laser on an airframe, lasers have interesting limitations as weapons. Lasers do not deal well with cloud cover. Hundreds of meters of cloud cover between two planes flying on instruments disrupts a laser's coherency, but not a guided missile's accuracy. After passing through a significant amount of cloud vapor, the laser will not have enough energy to damage the target or blind the pilot. You can imagine how unappealing spending money on a weapons system that is made useless by clouds is.
Another factor is that modern air combat is rarely 1 plane vs 1 plane. Ground radar, AWACS planes, satellites, and allied aircraft all work together. It does you no good to blind a single opponent if ground radar has locked on to you, because modern systems can pass that lock to missile launchers and other aircraft. Now anyone in range can launch a guided missile at you, a guided missile you can't blind.
As more airplanes become drone piloted, blinding the drone's cameras will not stop the operator from retaliating against you, because the drone's radar and other instruments are still functional.
So why spend money to solve a problem that is only tangentially related to your real problem? The problem is not that another pilot is in the sky. The problem is them being able to lock on to you with guided missiles, or even know you are around. If you have technology that prevents their missiles from acquiring an accurate lock, launching missiles is just a waste of money.
The Geneva Convention only addresses permanent blinding. Temporary blinding is all it would take to render an enemy pilot unable to react for at least long enough for you to employ evasive maneuvers and/or come around for an offensive. That said, one wouldn't even need a laser. Any sufficiently bright LED array would do the job.
Of course, this assumes the enemy pilot isn't equipped with any kind of eye protection.
In addition to the already mentioned Geneva convention, there is also the power requirements issue.
Lasers powerful enough for combat weapons require more electrical power than can be generated by a fighter (one reason why the YAL-1 was based on a Boeing 747).
Also, high power lasers generate a lot of heat. Heat dispersal in a small airframe is difficult, especially if you want to minimize your IR signature.
Because weapons of mass destruction are maintained and developed, the Geneva Convention might not be respected much during wartime.
Also, F-35s and F-22s have been mentioned in articles proposing laser weapons systems:
If ignoring the Geneva Convention, I'm not sure how effective such a weapons system would be. Wouldn't it be rather trivial to mitigate most or all of the damage by the enemy pilot, once such an imagined laser system is known to be used? The pilot would merely need to wear protective laser goggles or use other means of limiting the amount of light that enters the eye. The cost of developing the laser weapons system, compared with cost of the protection against it (laser goggles) doesn't seem to add up.
Also, an aircraft that sends out a continuous hundreds-of-kilowatt laser beam towards your own sensors provides an attractive target for your own missile.
You might impair the other pilot's visual flight when the beam is on, but looking down at the instruments to fire a missile should be possible when sufficient eye laser protection is worn.