Laravel is certainly the hottest PHP framework today and the number of users is increasing day by day. Laravel just created a new benchmark and ways to write PHP application that’s fun and enjoyable for everyone. Although the learning curve is high at first, it’s generally easy for everyone to dive in and very adaptable to a new users.
There are vast numbers of online resources out there now compared in the past, and this number is increasing as we speak. Compared to the first time I started with Laravel version 5, the current version during the writing of this post is 5.6 which I can say it really has a very active community.
Laravel follows many best practices, that includes both Object Oriented Programming and MVC patterns as well as other good standard convention which is the PHP Standard Recommendation (PSR). Because of that, Laravel breathe a new life to PHP in general and it’s up to today’s standard to grow to an even larger application.
What’s Inside the Box?
By default, Laravel came up with many things out of the box and this includes tools that will ease our web-based development. From the front end to the back end and even testing suite; that comes with fully loaded amazing tools and features ready to be used.
Going more details, everyone can start using Laravel easily on any platform that they desire. Either Windows, Linux or Mac OS; all of these platforms support Laravel and they share the same development environment. This is possible because Laravel comes out with Homestead, which is a tool that utilizes Homestead and Virtual Machines (VM). By making sure to have a constant development environment, everyone can have the same experience developing Laravel application across different OS platforms.
Moving on to code structure, Laravel is flexible and highly configurable. Newcomers can fully make use of the directory structure that has been provided out of the box and can start developing web apps right away. What’s nice about it is that Laravel also comes with an environment variable which is just a configuration variable that a user can edit and modify to change the behavior or even a feature of the application.
The Architecture Concepts
To me, this is the hardest part to fully understand and implement when writing a Laravel application. By default, Laravel have several architecture concepts that we have to add here to fully implement and make use of the features that it provides.
This part includes Request Lifecycle, Service Container, Service Provider, Facades as well as contracts. These architecture concepts are what glued Laravel together and made it unique compared to other frameworks out there. Getting started with this is tough, but when you know how it works, everything will start to ring.
Front-end and Security
Some of my past projects make use of Laravel as the back-end that provides the API and VueJS / ReactJS as the front-facing application that consumes the back-end resource. This is only one of the way but there are certainly many other ways that you can explore.
Security is taken seriously by Laravel and Laravel come with it by default. The documentation has described many best practices and conventions to use for dealing with security in Laravel.
Laravel also came with their own way of handling database. They came up with two flavors to choose from which are Eloquent and Fluent database. If you think writing SQL is not that fun and you are the type that hates database, Laravel will change your mind. Trust me, it will.
They support multiple database drivers out of the box and to switch between database, we can make use of the environment variables that are provided. Other than that, they also include migrations that will allow you to define your own database tables by writing codes that you can just run using the command line.
The command line is the heart of Laravel development and we essentially use it to generate and run many of commands that are being utilized by Laravel. Almost anything that we want to create manually by hand can be generated automatically. One thing that plays a very important role is Composer, which is a package manager for PHP applications.
Laravel make use of Composer and PSR-4 for the internal codebase structure; with Composer we can add or remove components that we can just use within our application.