Fathom Analytics CTO Jack Ellis decided to completely rewrite the company's codebase in 2019. Previously it was written in Go. Now it's written in PHP.
That might be surprising given that Go is an increasingly popular language—part of a vanguard of relatively new programming languages like Rust, Swift, and Kotlin that have seen tremendous growth in recent years. PHP on the other hand, is often seen as outdated, despite the fact that it's evolved considerably over the years and is the language used by 77.5% of all the websites with back-end languages that w3tech has been able to identify, including Wikipedia and countless WordPress sites. In StackOverflow's 2023 developer survey, Go was "admired" by 62.45% of respondents, while only 41.83% admired PHP.
But Ellis was more familiar with PHP. Plus he said using PHP gave him access to a secret weapon: Laravel.
Aaron Francis, a developer educator at PlanetScale and maintainer of the Laravel module Sidecar, echoes Ellis's sentiment. "Laravel enables me to be incredibly productive, and it's a joy to use," he said. "An incredible amount of care goes into everything, from documentation to code comments."
So how did the Laravel community build such a well-loved platform? By ignoring trends and sweating the details.
Outside the hype cycle
Laravel creator Taylor Otwell learned PHP in 2008, at the peak of the Ruby on Rails hype. "Ruby on Rails was very Mac-focused, and I just had a cheap Windows computer," Otwell explained. "You could write Ruby code on Windows, but you were sort of fighting against the ecosystem. PHP was more natural." Plus, it was easy to deploy PHP applications because the language was supported by practically every web host in existence. There were a few model-view-controller frameworks for PHP, some of which aimed to provide a "Rails-like" experience. But none was as comprehensive as Otwell wanted. So he built his own and released the first version in 2011.
Laravel wasn't an overnight success, but Otwell kept working on it. One big break came a few months after the first release of Laravel in 2011, when helpdesk software company Userscape hired him to work full-time on Laravel. "They used PHP and wanted to modernize a few things and saw Laravel as a path to that," Otwell said. "It was a big risk on their part. Laravel was new and there was still a lot to add."
Being able to focus full-time on Laravel helped Otwell set the project apart from other communities. Not only was he able to spend more time building features, writing documentation, and refining the developer experience, but he also spent lots of time engaging with the community, earning their trust, and learning what they needed. He founded his own company, also called Laravel, in 2014, which offers cloud hosting services for the framework. Otwell still works on the open source Laravel framework full-time while paying other developers to work on the paid services. It's a synergistic relationship: The better Laravel is, the more likely people are to use it, therefore there are more people interested in using the company's cloud platform.
Otwell said he tries to ignore hype cycles and just focuses on making Laravel as good as it can be. For example, Laravel, the company and the framework, avoided the crypto trend because Otwell didn't see any way it would make the Laravel developer experience better. On the other hand, he embraces new technologies and trends when there's an obvious benefit. The launch of the serverless solution Laravel Vapor is an example.
Today, the Laravel community is looking into the ways artificial intelligence can be leveraged to improve the developer experience. For years, Laravel has had an error-handling feature developed by a third party, the Belgian software development agency Spatie, that helps developers understand where they went wrong as clearly as possible. That's table stakes for any language or framework these days. But now Spatie has developed an OpenAI-based error handling feature that also provides suggestions for fixing the errors.
The Laravel way
Laravel’s “batteries included” nature is one of the most cited reasons that so many developers love the framework. It’s particularly comprehensive in its approach. It may have started out trying to catch up with Rails, but fans say it's now surpassed Rails in some ways. "Every web application needs queues, and with Laravel you get them for free right out of the box," Francis said. "In other ecosystems, queues support would be a paid add-on.”
Then there's the documentation. Otwell is particularly famous for the effort he puts into code comments, endeavoring to make each one exactly three lines long, with each line slightly shorter than the last. It's the sort of thing that might sound trivial but reveals the amount of thought and care that goes into every aspect of the framework.
Beyond the framework itself, however, is the community. "When I found Laravel, I didn't know how good it was technically, but the community was really nice and I wanted to be a part of it," said developer Zuzana Kunckova. Kunckova said Otwell and the other community leaders are exceedingly approachable, which makes the whole community more welcoming.
However, there were few women visible in the community when she started. "The men were nice, but when you don't see anyone who looks like you, it's awkward and it makes you question whether you belong," she said. Inspired by PyLadies and React Girls, she founded Larabelles, a community for PHP and Laravel developers under-represented due to their gender. "I might be biased, but I think the community has changed for the better," she said. "For example, there are more women speaking at Laracon now."
One thing that makes the community stand out is how focused it is on outcomes, rather than the internal workings of Laravel. As Elmore put it, the community is content to build stuff with Laravel, rather than debating the finer points of what Otwell and the Laravel team should do.
"There are people who don't like certain things, but in general it's the most satisfied community I've ever interacted with," said Mohamed Said, a former Laravel employee who is now VP of infrastructure at the Dubai cloud-based restaurant software company Foodics.
One way of looking at it is that Laravel attracts developers who would prefer not to spend so much time thinking about and fighting over these sorts of implementation details. Almost by definition, the community consists of people who have bought into Otwell's approach to building software. Anyone who doesn't like the opinions baked into Laravel is likely to bounce off it rather than spend time starting flame wars. That's not to say every Laravel user likes every aspect of the framework, or that Otwell doesn't listen to the community's input. But it does lead to fewer arguments. "We're not debating the best way to do authentication because it's already baked in," Ellis said. "It may or may not be the best way to do authentication, but we don't have to spend time arguing over it."
That could make Laravel's formula for developer happiness hard to reproduce. But everyone we spoke to agrees that Otwell's laser-focus on developer experience is something all maintainers can learn from. His attention to detail, from code to documentation, provides a strong example for others to follow. “Taylor is constantly looking for ‘papercuts,’ little annoyances that aren't that bad, but suck a little,” Francis said. “If he can fix enough of those minor things it adds up into something that just feels good to use.”
“Other tools focus too much on correctness and explicitness and not enough on developer experience," Said observed. "Laravel helps you deliver as much as possible with the least amount of code. When you see how much value you deliver, you get a sense of satisfaction that helps you keep on delivering."
Kunckova, meanwhile, points to kindness as the key ingredient in what makes Laravel successful. “The community is what it is because people actively try to make it nice, it didn’t happen by accident,” she said. “There is a drive among the people to be nice to each other, encouraging empathy and kindness. I think if more communities could adopt this approach, the internet would be a much nicer place overall.”
Why isn't everyone using it
The enthusiasm surrounding Laravel raises the question: If Laravel is so great, why isn't everyone using it? In a word: PHP. "The reluctance I've seen from companies has nothing to do with Laravel but with PHP's reputation," Said remarked. "People have an outdated idea of PHP based on what it was like 15 years ago."
This is a shame, Laravel developers agree, because the language is much better than most people realize. Said admits the language once struggled to keep up with its peers in terms of both features and developer ergonomics. But PHP has changed enormously over the years, providing an experience Francis describes as on par with that of Ruby or Python. The language has support for strong types—a boon for enterprise development—as well as first-class functions, concurrency, websockets, and much more. "Our package manager, Composer, is the best in the game," Francis said.
Otwell doesn't think PHP will ever be "cool" again and he prefers to spend his time making Laravel as good as it can be rather than evangelizing PHP. But Said, who lives in Dubai, has a different perspective. "PHP isn't cool in Silicon Valley, but here it's the complete opposite," he said. "People get excited when they hear a company uses Laravel. It is cool here."