Police will be able to issue immediate 12-month protections to alleged domestic violence victims after legislation passed state parliament.