The magazine of a laser may be unlimited but its rate of fire wont be and neither will the lifespan of its components under heavy load. Rail-gun 'barrels' also have a tendency to burn out.
When a swarm of 1,000 cheap sea-skimmers come over the horizon at Mach 5 how many can you shoot down? Rate of fire calculations any one?
How close does the singe nuke-tipped one buried in the swarm have to get?
Oh, almost forgot. Are these things any good against torpedoes which are pretty good these days? (Spot the sarcasm)
Surface ships are doomed in a serious exchange of views.