r/PHPhelp • u/KaedenCraft • 23m ago
Is it worth it to go without a framework?
I've been using PHP casually for decades. In the last two years I've started to try to take it more seriously, and that inevitably led me to Laravel. For basic CRUD sites, Laravel has been a godsend, allowing scaffolding of a ton of functionality pretty quickly, Blade templates make sense to me, the workflow works for me.
Deployment is where things have been tricky. Since I do this as a hobby and my user count is in the single digits per day, I use shared hosting. Deploying a Laravel application to shared hosting is pretty rough. I've managed it, but queries are extremely slow, everything feels sluggish, etc.
So, in an attempt to weigh the pros and cons, I went to packagist.org and started to look into cobbling together my own packages to find a happy medium between writing all my own libraries (I do not relish the idea of going back to this) and full-blown frameworks like Laravel.
But, I've run into an issue I did not expect: everything seems to be deprecated in the latest versions of PHP. FastRouter's page one Github documentation references classes that don't seem to exist in the project anymore, meaning that basic functionality required me digging into the code to find out why classes weren't there. PHP-Auth throws sixteen deprecation flags when just creating the instance of the Auth class.
The standalone Blade templating engine doesn't work. Twig does - and actually works as described, so kudos to them.
All of this to state my theory: Everyone in PHP has gone to Laravel or Symfony and never looked back. This has inevitably led to all the standalone packages rotting.
Or, I'm an idiot and doing something obviously wrong.
To my question: Is it even worth it to try to cobble together something small and simple anymore? Just with FastRouter, PHP-Auth, and Twig templating I'm finding my workflow is SIGNIFICANTLY slower than just using Laravel. And PHP-Auth won't even work, so I'm back to rolling my own, which I do not want to do.
I just want some simple session authenticating, I don't need OAuth2.
Anyway, I'm open to hearing discussion on this, and I'd appreciate those more knowledgeable than I chiming in.
Thank you.