PHP is actually awsome!
I am maintaining several Next.js applications at the moment. The number of dependencies and the vulnerabilities they bring are astonishing. For a while, I have been searching for something simpler—I don't really use Next.js's features for what I do anyway. Usually, the start page is static, and the remaining pages are client components. Or, everything is static.
I tried numerous frameworks and languages. For example, Elixir and the Phoenix framework, Ruby on Rails, and .NET 10. While they were all okay, none of them worked well for me. You know that feeling? Sometimes you find a tool that just clicks with your brain, and working with it becomes a much more intuitive endeavor. None of them were that.
Until I started building with PHP. Not Laravel or Symfony (which are fine), but classic PHP applications where the majority of the PHP code lives in the markup. To me, PHP is like the C of the web development world. It forces you to think about HTTP again. There are no heavy abstractions, nothing to just "make your life easier." That's good. I want to understand what is happening. Yet, it provides convenience and abstraction where it makes sense (like for generating tokens).
Building with PHP in that way forces you to use JavaScript as it was meant to be used, which makes using JavaScript fun again. It is really cool to observe it change the markup. It makes it possible to build applications that don't have heavy dependencies—not thousands of npm packages with thousands of vulnerabilities that you think you can get under control with CI. But that's just throwing complexity on top of complexity. Applications built that way can just be thrown onto a standard webspace—which is cheap and GDPR compliant—and the application will just work.
If you would like to get into it, I can recommend this book.
Since there seem to be few people left building web applications this way, there aren't many maintained libraries for authentication anymore. And not wanting dependencies anyway, I did the unthinkable and wrote my own authentication setup—and had a great time doing so.