10 Ways Laravel Will Boost Your Productivity | Developers familiar with Laravel already know that one of the main benefits of the framework is the speed with which good and robust results are obtained. If you haven’t had the opportunity to do a project with the “framework of the moment”, this article is definitely for you.
“Did someone say quick? Elegant applications delivered at warp speed.” – Laravel.com
Learn 10 ways Laravel will help you meet deadlines without leaving quality aside.
1. Migrations Laravel
Migrations are a versioning type for database schema. They allow you and your team to modify and evolve tables and columns so that everyone will have the most current version of the database.
Say goodbye to phpmyadmin, visual management software like mysql workbench and keep storing and transporting .sql files to the server. You have no idea how much time you can save using migrations.
2. The elegant Eloquent ORM
Eloquent is included with Laravel and provides a beautiful, simple and robust way to work with your database. Each database table has a corresponding “Template” that is used to interact with a given table.
If you’ve ever gotten your hands on accessing, inserting, and updating your tables without an ORM , I’m sure you have suffered as the complexity of the project has increased.
All interaction with the database is simple and intuitive with Eloquent. Access to database rows, table relationships and inserting new records can be done quickly and with all the security measures that the PDO does not offer you out-of-the-box.
Eloquent can be compared with Doctrine. Both have the same proposition, but Eloquent focuses on productivity and elegance rather than its swollen cousin (Doctrine).
3. Task Scheduling
Have you ever needed to add some kind of “scheduled task” to your application? To do this, you need to generate a Crontab entry for each task you want to schedule, and can sometimes be quite annoying.
Setting up your task schedule right on the server (not your application) requires you to do delicate watchmaking work, it’s difficult to test, version and find problems, and can end up with the stability of a house of cards.
With Laravel task scheduling we can create schedules within the application. With this you will have tasks running at the right time and without complication.
4. Painless Validation
Laravel has a very convenient validation component. With it you can easily validate forms and records before inserting into the database. All this already with standard error messages that are automatically generated with the name of the fields ( available and customizable in Portuguese ).
This validation system is simple to use and quite expandable. Check out the documentation and take a look at the examples .
5. Artisan and the command line
Using the operating system terminal / command line makes you look like a ninja hacker, this is unquestionable! But in addition, the command line gives you quick time to perform tasks and generate skeletons for your classes.
Are there any tasks you need to perform frequently in your application? Back up the base? Entering “maintenance” mode? Mark old signatures as “no access”? Just create your own artisan command and then, whenever you need it, just call it from the command line.
It may seem strange at first, but after some use you will understand why developers use the command line so much (besides looking like a hacker ninja, of course!).
6. Testing Email Triggers
If you have ever found yourself setting up or taking your SMTP server credentials to test your application’s email triggering you know how annoying it can be. Today there are several robust tools for testing email triggering . But the question is: Do you really need to invest so much time in this setup?
With Laravel, just choose “log” as your email driver and you’re done! Any email that your application shoots will be printed in the Log with all the necessary details. Very practical, isn’t it?
7. Helper Functions
While there is controversy surrounding the use of global scope functions, Laravel offers a number of optional functions that can save you time.
There are a number of functions for manipulating and accessing arrays that will surely boost your productivity (and make you uncomfortable). For example array_get , array_only , array_pull .
Manipulating strings, directories, debugging, and accessing environment variables is also made easier with helper functions.
Do not feel guilty about using these global functions. Coupling is very low even using these helpers, as the framework uses the Service Container to resolve the actual objects behind each of these functions. With this you can even change the original implementation of the helpers if you wish.
8. Composer and specific packages
Imagine if each Facebook friend helped you add functionality or solve something about your project. Now imagine you have 5000 friends!
The Packalyst.com lists Packagist.org packages that are specific to Laravel, with more than 5500 packages that will save you development time.
If you do not know composer , it is a tool that manages the dependencies and upload of your project files.
Composer can be used without framework and alone provides several benefits, but Laravel has a specific way to create better modules / packages for Laravel projects.
Packages for Laravel use the modularization power of ServiceProviders as they rely on the foundation of the framework present in your application. (Ie may be more powerful than generic packages)
Highlighting some packages that can prevent the “Wheel of re-invention” in his next project:
9. Front End Assets with Elixir
Elixir is a framework-independent tool that is already included with a clean install.
Now you can work with a variety of front-end tools without spending hours setting up all this. Elixir includes support for: Sass, Less, Source-Maps, CoffeeScript, ECMAScript6, Browserify, Babel, and more.
10. Receptive Community
Laravel is a framework that became popular for being user friendly. The creator, Taylor Otwell, has always been concerned with providing developers with great documentation, and the entire community has collaboratively embraced the cause.
“In my view, the best way I can serve my” customers “is by working very hard to present the absolute best” meal “I know how to create. And it’s served with the best documentation, the best website, the best community, and so on. ” – Taylor Otwell (http://productandsupport.com/taylor-otwell/)
The “Laravel eco-system” has a rich documentation, Laracasts, Codecasts, community in several countries (including Laravel Brazil has over 3000 members) with hangouts, meetings, tutorials and articles.
This will certainly save you time finding solutions to your problems and finding support material to further improve your programming and framework.
Some projects can be complicated to the point of seeming impossible. But good tools deconstruct complexity into concise, human, and accessible parts, saving time and effort.
“Any fool can make something complicated. It takes a genius to make it simple.” – Woody Guthrie
NOTE: Implemented on the foundation of Symfony components, Laravel does not neglect modularization, best practices and performance to offer the features that have been presented.