Laravel
created by Taylor Otwell and intended for the development of
web applications following the model–view–controller (MVC)
architectural pattern. And here are some of the reasons that I
would suggest giving Laravel a try and why I will NEVER go
back to another framework.
Composer
Laravel depends a lot of a number of external packages for its functionality. To do this, it is using Composer as a dependency manager. Why does this matter to you? For starters it makes it extreemly easy to get a new laravel project set up.
composer create-project laravel/laravel your-project-name --prefer-dist
and that will give you a full copy of laravel. Now you may think that this is just as complicated as remembering the url and running a `git clone` I would have to agree with you, however, these things are clearly mentioned in theLaravel Documentation .the next steps are the easy part. After you are done creating the project there are only a few more commands that you need to know
composer install composer update
The first one, `composer install`, sets up the laravel project and downloads all dependencies it requires to run. Down in the Laravel core are external packages, all pulled in with composer during the install, that include:
Symfony
Whoops
Doctrine
Symfony
Whoops
Doctrine
It is even just as easy to bring in another package into your laravel application by modifying the composer.json file. The one package that I ALWAYS include in my application during development is Laravel Generator by Jeffrey Way.
The final thing Ill say about the perks of Laravel using composer is that all of Laravel’s core components are individually available on the Illuminate GitHub repository.
Artisan
The command line is a very powerful tool for any developer. With Artisan, Laravel expands into being able to use the command line to run many different tasks. Just by typing `php artisan` in your terminal window, you are opened up to multiple options
... app app:name Set the application namespace auth auth:clear-resets Flush expired password reset tokens cache cache:clear Flush the application cache cache:table Create a migration for the cache database table config config:cache Create a cache file for faster configuration loading config:clear Remove the configuration cache ... migrate migrate:install Create the migration repository migrate:refresh Reset and re-run all migrations migrate:reset Rollback all database migrations migrate:rollback Rollback the last database migration migrate:status Show the status of each migration
These are just a few commands that are available. With artisan, you can even begin to make your own command line tools.
Database Migrations & Seeds
One pain point for me when I am developing an application is how to keep my database in sync between my development machines. With Laravel database migrations, it is extreemly easy. After a long day of work, I may have made a lot of changes to the database and, in my option, MySQL Workbench is not a great way to sync databases between my development machines. Enter Migrations. As long as I keep all of my database work in migrations and seeds (a file that populates a database), I can easily migrate the changes into any other development machine I have. The other nice part of these is that I am now able to keep my database under version control too.
RESTful Routing
This is by far one of the best things in laravel. If you do not know what REST is, check this tutorial out to get more information. Laravel makes it very nice in the way it uses verbs for its routes. Here is a sample of a route file:
Route::get('dogs',function() { return 'These are the dogs!'; });
Route::get('dogs/{id}', array('uses' => 'DogsController@show'));
// Will trigger the show method in DogsController
Route::post('dogs', array('uses' => 'DogsController@create'));
// Will trigger the create method in DogsController only if posted to
...
These are just a few of the reasons why we have switched to Laravel for Coupley Match Making App and why Laravel is the best PHP Framework.
No comments:
Post a Comment