This is all in a performant, reliable and secure compiled language (Java). Language improvements and modern frameworks have also addressed the long-winded code which used to be an issue.
A.k.a., Kotlin. :p
In all seriousness, though. The only thing PHP still has over Java is that when I say my function takes Foo type, you can't give it null instead.
Admittedly, limiting the selection to first-party code might be a bit unfair to frameworks that maybe simply rely more on community-built extensions, but I have to draw the line somewhere, otherwise I guess every framework theoretically "supports" everything through some third-party module that may or may not work ;)
... Just to avoid confusion
> Hashing
> Encryption
> CLI commands with option/argument parsing, colored output, progress bars etc. (Do you mean a management console? All of them have it.)
Except for those, Django has every single one.
Encryption: Support for securely encrypting, signing, decrypting and verifying arbitrary payloads. In Laravel, you can do:
$plaintext = 'foobar';
$encrypted = $encrypter->encrypt($plaintext); // this will encrypt the plain text, generate a MAC and combine everything into a base64 encoded payload
$decrypted = $encrypter->decrypt($encrypted); // this will decode the payload, verify its MAC and decrypt it, giving you back the original plain text
$decrypted === $plaintext; // true
As for CLI commands, I meant the ability to easily create your own commands. Here's [1] the relevant Laravel docs, for example. You can create commands and they will have access to all the things you can use in a HTTP context too, other than the actual HTTP stuff like the current HTTP request, because there obviously isn't one. So, for example, you could write a command that would use the ORM to perform some maintenance tasks on your database.RoR and Django both have extensible management commands, and all frameworks that I have ever seen allow you to create independent CLI commands (it's on PHP that the CLI is a second class citizen).
I might have missed it, but I couldn't find any documentation on how to create custom commands in RoR. For Django I found [1] (through "python manage.py" from what I understand) and that does look like it's more or less the same as Laravel's "php artisan", with commands provided by the framework as well as the ability to add your own.
Anyway, I wasn't trying to attack RoR or Django, as those are actually the best alternatives to Laravel I know of. I worked on an existing Django project for a bit and while I don't like Python, Django seemed just fine to me for the most part. I did want to express my disagreement when it comes to the original claim of "any framework in any language can do what PHP frameworks can do" though.
[1]: https://docs.djangoproject.com/en/3.0/howto/custom-managemen...
Oh, a complete agreement on that.
This conversation sidelined from some people talking about Java, .Net, Go and Rust. None have anything similar to the big web frameworks. And while I'm not completely sure about Rust, I do believe that none even can have it.
Django.
Revel.
Actix.
Like I can't find any official RoR support for payments, full text search, encryption, pagination, scheduled tasks or building CLI commands.
With Django, full text search seems limited. It supports PostgreSQL, but I couldn't find first-party integration for Algolia, Solr, Elasticsearch etc. or a generic way to add backends (pluggable drivers) for them. There's support for WebSockets through Django Channels, but it seems a lot more basic than Laravel's broadcasting system. No official support for queued jobs or schedules?
Revel doesn't seem to have support for building CLI commands, encryption, emails, pagination etc. Apparently, any kind of database access or ORM isn't even first-party?
The inclusion of Actix in this list confuses me. From what I understand, Actix isn't a web framework at all, it's more like a foundation for using the actor model.
(I didn't exhaustively analyze everything, there's certainly more things missing from some of those frameworks)
I'm not saying they should, just comparing features for the sake of demonstrating that the functionality that's present in modern PHP frameworks isn't readily available in just any random framework in any random language.
The thing is that nobody would choose that configuration for the PC under normal circumstances. Normally you would spec it based on your actual use case and the PC would end up both cheaper than the Mac and better suited to the use case.
Sorry, the point I was originally trying to make might have gotten lost in all the discussion about specific features.
It was in response to this:
>> choosing php for a new project is a no-brianer. The only other 2 stacks to which I can compare it are the Spring stack of Java or .NET core
> This is absolutely not the case, and you know it. Almost every language has a wealth of HTTP tools and frameworks, and many of them come built-in.
The way I read it, this comment claims that everything that can be done in PHP using PHP frameworks could also be done in almost any other language using one or several frameworks written in that language. In my experience, this simply isn't true. There are other frameworks in other languages that have a feature set similar/equal/maybe superior to what Symfony or Laravel offer in PHP, but those are very rare. Like "there's maybe 2 or 3 of them in existence" kind of rare. Rails, Django, maybe one or two more? It's a short list. Again, not exactly "almost every language" and all that.
Of course, any language could have frameworks offering those kinds of features, but in reality, most simply don't. For a new web project, PHP, Ruby or Python are still fine choices if you're comfortable using those languages. There's nothing wrong with using, say, Go instead. But to claim that Go (just using it as an example here, not trying to criticize Go in particular) just has one or several web frameworks lying around that can do what Laravel, Rails or Django can is simply dishonest.
Lots of languages have HTTP tools and frameworks, but not many of them are even comparable in scope to Symfony or Laravel. Out of curiosity, can anyone point me at some frameworks in other languages that have the following things built-in?
* Route matching and dispatch
* URL generation (generate a URL for some route) including signed and temporary URLs
* Middlewares
* Abstractions for dealing with incoming HTTP requests (getting headers, body, uploaded files etc.)
* Abstractions for creating and sending HTTP responses (headers, body etc.)
* CSRF protection
* Database drivers for a couple of backends (MySQL, PostgreSQL, SQLite etc.)
* Database migrations
* Database seeding
* Views/HTML rendering
* Logging capabilities (configurable backends like rotating log files, syslog, Slack etc.)
* Sessions with different storage backends (filesystem, Redis etc.)
* Request validation ("this field is required, has to be a string, between x and y characters long" etc.)
* Translation and localization
* Broadcasting through WebSockets
* Caching with a couple of backends (filesystem, database, Redis etc.)
* Email sending with a couple of backends (SMTP, Mailgun, SES etc.)
* Notifications with different channels (Email, SMS etc.) and backends (SMTP, Mailgun, Twilio etc.)
* Job queues with different backends (database, Redis, SQS etc.)
* Scheduled jobs
* Authentication (different flavors like regular sessions, API tokens etc.)
* Authorization
* Hashing
* Encryption
* Query builder
* ORM with relations between objects, JSON serialization etc.
* CLI commands with option/argument parsing, colored output, progress bars etc.
* Events, including async handling of events
* File storage with a couple of backends (local filesystem, S3 etc.)
* Pagination
* Payment integration
* Full text search with different backends (database, Algolia etc.)
This is basically the feature set of Laravel, I probably missed some things too.
And I don't mean "oh yeah I'm sure there's a library for that" - I mean fully integrated, first-party, tested, dead simple to use and available by default.
Maybe I'm wrong, but I seriously doubt this just exists in any language.