We gave Luqmaan hikmah

And We had certainly given Luqmaan wisdom [and said], "Be grateful to Allaah." And whoever is grateful is grateful for himself. And whoever is ungrateful, then surely Allaah is Self-sufficient, Praised.

[Qur'aan 31:12]

 

The majority of scholars of Qur'aanic interpretation  are of the view that Luqmaan was a wali (friend) of Allaah and not a Prophet.

Some scholars like 'ikramah are of the of opinion that he was a prophet. Based on this view the hikmah [wisdom] mentioned in the Verse refers to prophethood.

To be thankful to Allaah means to obey Him by following His Commands and staying away from the things He has forbidden.

And he who is grateful is grateful for himself means that whoever obeys Allaah does good for himself because he will be rewarded for doing so.

The one who disbelieves in the favors of Allaah by being ungrateful and does not believe in the Oneness of Allaah then Allaah is Self-Sufficient and in no need of the worship of His creation. He needs no one and is praised in all He does.