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.
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.