The law is being hailed as a milestone for app-based drivers in their years-long battle to expand workplace rights.