Join Joseph Lowery for an in-depth discussion in this video Exploring the foundations of Laravel, part of Learning Laravel 4.
As noted in the previous introductory lesson, Laravel is built on a strong foundation of best of breed components. In this lesson we'll take a look at a few of the primary ones. Included in the survey are Symfony, Composer, sensing a theme here, eh? Eloquent ORM and Blade. Now, Blade is the only one not mentioned earlier and as you'll discover soon, it's Laravels templating engine.
I'd like to stress that these are just a number of the key components. One of Lavarels real strengths is how it leverages the latest generation of programming libraries. Laravel is a framework built on a framework. In fact, several of them. And Symfony is a primary framework source for Laravel. The current version of Laravel uses a number of different components from Symfony, including Browserkit, Console, Debug and FileSystem libraries.
Because of the tight dependency on Symfony, Laravel has committed to staying in sync with coordinated release schedules. Interestingly enough, the flow goes both ways, it's also possible for Symfony users to work with Laravel components. For more information about Symfony, visit symfony.com Laravel requires a good number of additional libraries to function, moreover your app is likely depend on others.
For efficient development, Laravel supports Composer, a PHP dependencies manager. Composer works on a per project and not a global basis, and is Mac, Windows and Unix compatible. Dependencies are declared in a json file named composer.json There are a great number of third party packages for Laravel and other PHP uses at packagist.org To learn more about composer, check out composer.org you'll get first hand knowledge of it when we install Composer in the next lesson and of course packagist.org for those third party packages.
Database access and management are an important if not critical aspect of most web applications. Laravels database component is called Eloquent ORM an acronym for Object Relational Mapper. Eloquent was created for and by Laravel, but as it is a self contained package, it can be used outside of the framework. Eloquent works with a ActiveRecord pattern, which allows easy inserting, updating and deleting of records.
It can handle one to one, one to many and many to many relationships within the database. Tables can be created, seeded and managed through migrations. We'll devote several lessons in chapter two to using Eloquent in Laravel. Finally, we come to Blade. Blade is Laravels templating engine. To invoke Blade processing, you simply have to save a view with the extension .blade.php Variables are easily passed if they are within a double curly brace syntax.
You can also put any PHP code, like the date function within the same delimiters and it's automatically translated. Blade also supports a variety of conditional controls and template inheritance. Blade is discussed more fully in chapter three. Laravel really has taken a good look around and incorporated the best features from existing PHP libraries and from those of other platforms like Ruby on Rails, as well as developing its own systems internally.
So now, with a better understanding of how Laravel is structured, it's time to begin the installation process.
- Installing Laravel
- Handling testing
- Establishing an HTML view
- Connecting to a database
- Enabling version control
- Setting up-and-running unit tests