Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Toptal.com:
PHP Frameworks: Choosing Between Symfony and Laravel
Mar 02, 2017 @ 11:26:17

On the TopTal.com blog Karin Sakhibgareev shares some of his thoughts around picking the right framework for your project. More specifically he focuses on the selection between two popular options: Symfony or Laravel.

Today, when starting a new project, one of the key decisions is to pick the right framework. It’s become hard to imagine building a complex web application from scratch nowadays without one.

Many popular languages for web development have their “default” framework, such as Ruby on Rails for Ruby, or Django for Python. However, PHP has no such single default and has multiple popular options to choose from.

[...] In this article, I am going to compare these two frameworks and show you how to implement simple, everyday features with each. This way, you can compare the code of real-life examples side by side.

He starts with a brief history of each project (Symfony and Laravel) and quick guides to getting them installed. He then configures them with a few basic options (database connection, security details, etc) and compares the setup processes against each other. The reminder of the post follows the same pattern covering:

  • routing setup and configuration
  • templating (Blade vs Twig)
  • dependency injection
  • database usage via ORMs
  • event dispatching/middleware

The post ends with a sort of "real world" application of each framework, showing what it would take to create a simple REST API. He finishes with his thoughts about the "winner" of the comparison...but suggests that it's more about the right tool for the right job than one framework that does it all.

tagged: toptal framework symfony laravel tutorial comparison

Link: https://www.toptal.com/php/choosing-between-symfony-and-laravel-frameworks