Advantages and Disadvantages of Laravel
Laravel is one of the most popular PHP web frameworks following the MVC (Model-View- Controller) pattern. Created by Taylor Otwell, the framework is free and open source, hence intended to help you come out with high quality products. The codes will be reduced, but it will also be as per industry standards so you can save hundreds of hours on development time. The first release was on 2011, and the current version came out with Laravel 5.4.
According to W3Techs, PHP powers over 82% of the websites that we see, like Flickr, Facebook, WordPress etc. PHP, as a server side programming language is a great choice because lets you focus on the key fundamentals, helps you scale whenever you need to, and makes rapid development easier, with easily maintainable codes.
The basic features of Laravel at a glance:
- Bundles or small functionality packages
- Class Autoloading
- Unit testing
- View Composer
- Eloquent ORM
- Application Logic
- The IoC container
- Restful Controllers
- Reverse Routing
Advantages of Laravel
1. Makes use of the newest features of PHP
One of the features that set this framework apart from other frameworks is that it makes use of all the new features of PHP. Other frameworks don’t do that. Using Laravel 5 would take you directly into some of the newest features that PHP has on offer, especially in Namespaces, Interfaces, Overloading, Anonymous functions and Shorter array syntax.
2. Great documentation
It is the documentation of Laravel that makes it really developer-friendly. All the versions of Laravel are released with proper documentation , and you will find good and detailed explanations of coding style, methods and classes.
3. Integration with mail services
It is mandatory for web applications to keep their users informed of new deals and offers. New user registration is also important (i.e. notifying the new user when he/she registers). The framework is equipped with clean API over SwiftMailer library. And there are drivers for SMTP, Mailgun, SparkPost, Mandrill, PHP’s “mail” function, Amazon SES, and “sendmail” to help you send mails through cloud based or local services.
4. Supports popular cache backends
Laravel supports cache backends like Memcached and Redis out-of- the-box. You can also configure multiple cache configurations.
5. Has built-in tool for command-line called Artisan
Developers usually find it tedious to perform those repetitive programming tasks because they are heavily time-consuming. The command-line tool called Artisan, helps them create a skeleton code and manages the database system successfully. Artisan helps in generating the basic MVC files and managing assets, including their respective configurations.
6. Packages and resource availability
You can benefit from npm packages and bower packages by combining the framework with Gulp and elixir. This helps in resource and asset revisioning. This integration with composer will resolve dependencies and is hence, the most reliable source of package in the PHP world.
7. Reduced product development cycle
You can considerably reduce product development cycle because the integrations are faster, and there is a very huge community support, you have the support of Laracasts.
8. IoC Container
Also called Inversion of Control, it is a method for generating new objects and you don’t have to bootstrap any external libraries. In other words, you can access these objects from wherever you are coding, no longer would you have to deal with inflexible monolithic structures.
9. Reverse Routing
This is a very useful feature in the framework where you can create links to named routes. So when you create the links, just use the router’s name, and the framework will insert the correct URL automatically. And when you need to change the routes in future, the changes will be automatically be made everywhere.
10. Eloquent ORM
This is one of the most beautiful features of Laravel. It provides a simple and very nice ActiveRecord implementation for working with your database. In other words, it means that the models you create in the MVC will have a corresponding table in the database. The ORM has built-relationships, so if you manipulate one table in the database, you manage the related data as well. The following relationships are possible => one-to- one, one-to- many, many-to- many, has- many- through, polymorphic relationships, and many-to- many polymorphic relationships.
The demerits of the PHP framework
The advantages are many, and the cons are few. However, we will go through them as well:
1. Does not support payments feature
However, that wouldn’t be worrisome if you are not going to manage the payments yourself, because you will have to go through the PCI compliance rules and regulations. Deferring to services like Stripe and Paypal would solve that problem for you. You can also try any online commerce site and build your application within their rigid, and narrow templates. Or you can make use of the framework’s libraries that would let you integrate payment methods. Most e-traders, however, prefer to embed a third-party payment processor for convenience.
2. Lack of continuation between versions
There is no seamless transition from Laravel 4 to 5. If you try to update the code, it could break the application.
3. Quality is mixed at times
Certain components in the framework are not well-designed. For example, dependency injection becomes unnecessarily complex at times. The documentation is also heavy. You have to learn lot before you get down to build applications.
Hence, this is not a very good choice for amateur developers. However, the framework is improving, greatly. Version 5 is much better, with lesser number of flaws.
4. Some upgrades might be problematic
This is not solely a Laravel problem, but PHP frameworks do show problems for long term support versions as the upgrades may turn problematic. So the developers are advised to take precautions before upgrading a mobile application/website.
5. Often fails to provide mobile app richness
Full-page reloads can be a bit heavy in mobile apps when compared to websites. In such cases, web developers tend to use the framework as backend JSON API only.
According to Taylor Otwell, “Laravel is the strongest contended in the PHP ecosystem simply because it includes the features needed to build modern web applications”. It is thus a classy and clean framework, with elegant syntax for building great applications. Just be mindful of the cons, that’s all.
Picture source: Flickr.com/ OMURA/ Michael
The author: Reema Oamkumar is engaged as a thought leader at www.Software-Developer-India.com which is a part of the YUHIRO Group. YUHIRO is a German-Indian enterprise which provides programmers to IT companies, agencies and IT departments.