I was writing my own code but there are very powerful frameworks now. If you try to code everything yourself it will take too much time. It is better to use a powerful framework with a good code knowledge.
Yes but before coding my own stuff, I check if there is not a similar things available on GitHub. Then I check if I can use reuse the code or extend it. Sometime you will find that using an existing code it more time consuming than building your own stuff.
Most of the stuff I'm working on I code myself. SOmetimes It may feel like reinventing the wheel, but if you want to improve yourself, it needs to be done. I know my framework will never be better than Laravel, Symfony or Yii, but it is important because by coding your own stuff you have to study and by studying you are furthering your own knowledge and therefore skills.You don't need to use your own product for production level applications, but it is important to code your own stuff for the longest time. it;s the only way how you can really learn to code.
edit: Also, don't use editors such as Sublime, Atom or Brackets.io. Give PHPStorm a try. Full fledged IDE is way better and will help you understand and maintain your code way better and more efficiently than any editor. First 30 days are free so it's worth a shot. And then use a cracked version / extend the evaluation version indefinitely (there are tutorials for this) and if you start making money with it, invest in it. It's just a few $ monthly and it is well worth it.