This script will allow you to use the property drawer [SortingLayer] over a sorting layer id property, like:
[SortingLayer]
public int SortingLayer = 0;
I hope you find this useful for your projects 🙂
EDIT: code updated using the solution given by Sergi