and he had said "obey my laws" which was referring to the 10 commandments.
I think this is an incorrect assumption.
When Jesus referred to God's laws, He said, "It is written".
When Jesus referred to the rest of the laws, He said, "You have heard it has been said".
So let's take a look at some examples of this.
Matthew 5:21 Ye have heard that it was said by them of old time,
Thou shalt not kill; and whosoever shall kill shall be in danger of the judgment:
Matthew 5:27 Ye have heard that it was said by them of old time,
Thou shalt not commit adultery:
Matthew 5:31 It hath been said, Whosoever shall put away his wife, let him give her a writing of divorcement:
Matthew 5:33 Again, ye have heard that it hath been said by them of old time, Thou shalt not forswear thyself, but shalt perform unto the Lord thine oaths:
Matthew 5:38 Ye have heard that it hath been said, An eye for an eye, and a tooth for a tooth:
Matthew 5:43 Ye have heard that it hath been said, Thou shalt love thy neighbour, and hate thine enemy.
Matthew 4:4 But he answered and said, It is written, Man shall not live by bread alone, but by every word that proceedeth out of the mouth of God
Matthew 4:7 Jesus said unto him, It is written again, Thou shalt not tempt the Lord thy God
Matthew 4:10 Then saith Jesus unto him, Get thee hence, Satan: for it is written, Thou shalt worship the Lord thy God, and him only shalt thou serve.
Matthew 21:13 And said unto them, It is written, My house shall be called the house of prayer; but ye have made it a den of thieves.
Mark 7:6 He answered and said unto them, Well hath Esaias prophesied of you hypocrites, as it is written, This people honoureth me with their lips, but their heart is far from me.
John 6:45 It is written in the prophets, And they shall be all taught of God. Every man therefore that hath heard, and hath learned of the Father, cometh unto me.
When Jesus quotes the 10 commandments with the exception of Mark 7:10 He never says "It is written.
In Mark 7:10 He says, "Moses says", but earlier in the chapter He says this is a command of God that the Pharisees were ignoring.
The 10 Commandments were given to show us our sinful state.
Romans 7:7 What shall we say then?
is the law sin? God forbid. Nay, I had not known sin, but by the law: for I had not known lust, except the law had said, Thou shalt not covet.
Galatians 3:19 Wherefore then
serveth the law? It was added because of transgressions, till the seed should come to whom the promise was made;
and it was ordained by angels in the hand of a mediator.