Chapter 1. Designing Done Right with phpspec

Many things have happened since Laravel's humble beginnings in 2011. Taylor Otwell, a .NET programmer, sought out PHP as a way to do a side project, since he was told that hosted PHP was cheap and ubiquitous. What originally started out as an extension to CodeIgniter become its own code. Freeing up the code base from the limitations of CodeIgniter's PHP 5.2, all of the new features that PHP 5.3 had to offer, such as namespacing and closures, could be used. The time span between the release of versions 1 and 3 of Laravel was only one year. With version 3, things happened very quickly. After its explosion in popularity, which happened around the time that version 4 was released, it quickly began to steal the market share from other popular frameworks such as CodeIgniter, Zend, Symfony, Yii, and CakePHP to eventually take the pole position. Along with its expressive syntax, great documentation, and a passionate founder came large community mainstays the IRC and Slack chat room, The Laravel Podcast, and the Laracasts instructional video website. Also, the newly created commercial support such as Envoyer, which provides 100 percent uptime, means that Laravel was also welcomed by enterprises. With the release of Laravel 4.2, the minimum required PHP version was increased to 5.4 to take advantage of modern PHP features such as traits.

Using Laravel's traits along with the new syntax, such as the [] array shortcut, makes coding a breeze. Laravel's expressive syntax, coupled with these modern PHP features, makes it a great choice for any developer who wishes to build robust applications.

Designing Done Right with phpspec

Laravel's rise in success, as reported by Google Trends

A new era

In late 2014, the second most important part of the history of Laravel occurred. When what was scheduled to be version 4.3 changed many of the core principals of Laravel, the community decided that it should become version 5.

The arrival of Laravel 5 brings about many changes in the way we use it to build software. The built-in MVC architecture that was inherited from frameworks such as CodeIgniter has been abandoned in favor of being more dynamic, modular, and even daringly framework-agnostic. Many of the components have been decoupled as much as possible. The most important part of Laravel's history will be the arrival of Laravel version 5.1, which will have long-term support (LTS). Thus, Laravel's place in enterprises will be solidified even more. Also, the minimum PHP requirements will be changed to version 5.5. So, for any new projects, PHP 5.5, or even PHP 5.6, is recommended because upgrading to PHP version 7 will be even easier.

A leaner app

The /app directory was slimmed down, leaving in only the most essential parts of the application. Directories such as config, database, storage, and tests have been moved out of the app directory since they are auxiliary to the application itself. Most importantly, the integration of the testing tools has matured drastically.

PSR

Thanks to the efforts of the Framework Interoperability Group (PHP-FIG), the developer of the PHP Standard Recommendation (PSR), the reading, writing, and formatting of the framework code is becoming easier. It even allows developers to more easily work in more than one framework. Laravel is a part of the FIG and continues to adopt its recommendations into the framework. Laravel 5.1, for example, will adopt the PSR-2 standard. For more information about the PHP FIG and PSR, visit the PHP-FIG website, http://www.php-fig.org.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset