And from first-hand experience, while the specific code sample shown on this page shouldn't be treated as a practical example of how to architect a larger application, there's nothing compromised here in terms of performance or testability.
All tech is tech debt at some level or at some time - what has happened to pragmatism? Laravel has actually helped me write the most performant, tested and least-refactored code I've ever written.
Like any tool, used properly it will do its job well; simply grumbling and shooing it away does not stop it being a perfectly fine tool in the right hands.
Oh look, you even say so in your own comment: "the specific code sample shown on this page shouldn't be treated as a practical example".
So... you're saying the page makes it SEEM simpler than IT IS, hmm? Is this what you were asking me about "why is it bad"? You don't think parlor tricks in demo code is a bad thing?
So what are you even objecting to here? I said something bad about Laravel, and you use Laravel, so you have to go on the offensive out of loyalty? I don't know why people need to identify so religiously with their tools. If we start picking apart this demo code, you'll probably admit that every line contains an anti-pattern you'd avoid in a real project of more than a modest size.
So what is this demo demoing then? It's essentially misleading people about what it takes to write a good app. If we'll go by simple demos alone, PHP needs no framework at all for a good demo:
<?php
echo "5 + 5 is: " . (5 + 5);
Boom, everyone understands this, now you can write your own Google!This is why RoR declined and it's why PHP with Laravel and WordPress as their poster boys is declining.
PHP itself is no longer as terrible as it used to be, although all the good people seem to have left the core team. But the frameworks people use on it are terrible.
5 + 5 = <?= 5 + 5 ?>
why use echo? php _is_ html :DMore or less directly opposite of what Laravel is preaching. It's the popular choice for anything that is being build long term. It is very popular in Europe and we have a far bigger community around it than Laravel does.
Architecture: The default structure of the app is good to start out and can be changed at any time. You are not locked into that. If you apply your fancy patterns, you can do whatever you want. It's rather a devs fault than the frameworks fault.
Performance: Guess depends on what you compare it to. Surely a rust service will be more performant, however you can scale laravel just fine if you are not writing shit code. There is enough apps built in laravel that handle more load than the average pro reddit coder will ever see.
Testability: Not sure what you mean, you can test in different ways and anything you need to test. It's fairly simply too. Yes, there are sometimes issues where you can run into memory leaks but those can be fixable after some digging.
You can but don't need to use facades, you can go full DI, you can swap the IC.
The Irreducible, unfixable tech debt is created by the developer that wrote it and does not know php or laravel. Yes, laravel makes it easy for newcomers to get right into the traps you mentioned, but then again - we are talking about junior that would not know any better and probably would fail without it.
What you call "full DI" in Laravel is still globals in disguise, because there's a single global container.
Most defense of Laravel comes from people who have no idea how to write a good app. And unfortunately, due to bad frameworks, the number of those people is multiplying. I blame Spring and RoR. So much pain came from them. Laravel is just a pale copy.
And worst of all, you are stuck with a shitload of churn every time a new Laravel version comes out. But this is true for Rails and CakePHP and probably many others as well. At least Django seems to be moving a bit slower and not deprecating loads of features on every release.
For those who know PHP, this code is full of singletons masquerading as static classes (which Laravel incorrectly calls "Facades") which mean no isolation and clear flow of dependencies in your code. In a nutshell, every line of code you write this way comes loaded with a pound of irreducible, unfixable tech debt. Enjoy.