What is Laravel
What is Laravel ?
In the jungle of PHP frameworks, the latest newcomer, Laravel, has been getting
more and more attention recently. On many discussion forums, it has even
dethroned CodeIgniter and Symfony as the number one recommended framework.
What is it about this framework that makes both young and seasoned developers
rave about it?
In this chapter, we will cover the following topics:
• How web application frameworks help to increase productivity
• The fundamental concepts and the key features of Laravel
• The general structure and conventions of a Laravel application
• General advice if this is the first time you are working with a
Model-View-Controller (MVC) framework
• Migration tips for users of the previous version of Laravel
We will look at its key features and how they have made Laravel an indispensable
tool for many web developers. We will present the limitations of PHP, especially
when it is used without a modern framework, and how Laravel helps you to
overcome those shortcomings and write more robust, and more structured,
applications. Then, we will take a closer look at the anatomy of a Laravel application
and present the different features of PHP as well as the third-party packages it
leverages. After reading this chapter, you will have all the conceptual knowledge
that is required to get started and build your first application.
The need for frameworks
Of all the server-side programming languages, PHP undoubtedly has the weakest
entry barriers. It is almost always installed by default on even the cheapest web
hosts, and it is also extremely easy to set up on any desktop operating system. For
newcomers who have some experience with HTML, the concepts of variables, inline
conditions, and include statements are easy to grasp. PHP also provides many
commonly used functions that one might need when developing a website. All of
this contributes to what some refer to as the immediacy of PHP. However, this instant
gratification comes at a cost. It gives a false sense of productivity to beginners, who
almost inevitably end up with unnecessarily complex and tangled code as they add
more features to their site. This is mainly because PHP, out of the box, does not do
much to encourage the separation of concerns.
The limitations of homemade tools
If you already have a few PHP projects under your belt, but have not used a web
application framework before, then you will probably have your personal collection
of commonly used functions or classes that you have amassed from one project to the
next. These utilities help you solve recurring problems, such as sanitizing database
calls, authenticating users, and including pages dynamically. You might also have a
predefined directory structure where these classes and the rest of your application
code reside. However, all of this will exist in complete isolation; you would be solely
responsible for the maintenance, inclusion of new features, and documentation.
This can be a tedious and time-consuming task. Not to mention that if you were
to collaborate with other developers on the project, they would first have to get
acquainted with the way you build applications.
Laravel to the rescue
This is exactly where a web application framework such as Laravel comes to the
rescue. Laravel re-uses and assembles existing components to provide you with
a cohesive layer upon which to build your web applications in a more structured
and pragmatic way. Drawing inspiration from popular frameworks written in both
PHP and other programming languages, Laravel offers a robust set of tools and an
application architecture that incorporates many of the best features of CodeIgniter,
Yii, ASP.NET MVC, Ruby on Rails, and Sinatra.
If you have already used one of those tools or a different framework that implements
the Model-View-Controller (MVC) paradigm, you will find it very easy to get
started with Laravel 4.
In the jungle of PHP frameworks, the latest newcomer, Laravel, has been getting
more and more attention recently. On many discussion forums, it has even
dethroned CodeIgniter and Symfony as the number one recommended framework.
What is it about this framework that makes both young and seasoned developers
rave about it?
In this chapter, we will cover the following topics:
• How web application frameworks help to increase productivity
• The fundamental concepts and the key features of Laravel
• The general structure and conventions of a Laravel application
• General advice if this is the first time you are working with a
Model-View-Controller (MVC) framework
• Migration tips for users of the previous version of Laravel
We will look at its key features and how they have made Laravel an indispensable
tool for many web developers. We will present the limitations of PHP, especially
when it is used without a modern framework, and how Laravel helps you to
overcome those shortcomings and write more robust, and more structured,
applications. Then, we will take a closer look at the anatomy of a Laravel application
and present the different features of PHP as well as the third-party packages it
leverages. After reading this chapter, you will have all the conceptual knowledge
that is required to get started and build your first application.
The need for frameworks
Of all the server-side programming languages, PHP undoubtedly has the weakest
entry barriers. It is almost always installed by default on even the cheapest web
hosts, and it is also extremely easy to set up on any desktop operating system. For
newcomers who have some experience with HTML, the concepts of variables, inline
conditions, and include statements are easy to grasp. PHP also provides many
commonly used functions that one might need when developing a website. All of
this contributes to what some refer to as the immediacy of PHP. However, this instant
gratification comes at a cost. It gives a false sense of productivity to beginners, who
almost inevitably end up with unnecessarily complex and tangled code as they add
more features to their site. This is mainly because PHP, out of the box, does not do
much to encourage the separation of concerns.
The limitations of homemade tools
If you already have a few PHP projects under your belt, but have not used a web
application framework before, then you will probably have your personal collection
of commonly used functions or classes that you have amassed from one project to the
next. These utilities help you solve recurring problems, such as sanitizing database
calls, authenticating users, and including pages dynamically. You might also have a
predefined directory structure where these classes and the rest of your application
code reside. However, all of this will exist in complete isolation; you would be solely
responsible for the maintenance, inclusion of new features, and documentation.
This can be a tedious and time-consuming task. Not to mention that if you were
to collaborate with other developers on the project, they would first have to get
acquainted with the way you build applications.
Laravel to the rescue
This is exactly where a web application framework such as Laravel comes to the
rescue. Laravel re-uses and assembles existing components to provide you with
a cohesive layer upon which to build your web applications in a more structured
and pragmatic way. Drawing inspiration from popular frameworks written in both
PHP and other programming languages, Laravel offers a robust set of tools and an
application architecture that incorporates many of the best features of CodeIgniter,
Yii, ASP.NET MVC, Ruby on Rails, and Sinatra.
If you have already used one of those tools or a different framework that implements
the Model-View-Controller (MVC) paradigm, you will find it very easy to get
started with Laravel 4.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment