Some important features in Laravel Framework
1. Artisan: Artisan is a command-line interface tool which is provided by laravel. By using this tool, users can create database structure. It is also used for creating the MVC files right away which means you can create model files in Model folder, view files in Views folder and controller files in Controller folder by typing this command on the terminal.
2. Template Engine: Laravel provides powerful template engine “Blade” for creating view files. It helps you to create layout for your views by using distinctive sections. For example, you can create one master template file and this file can be extended by other pages on your website.
3. Routing: This is the main feature provided by laravel framework. You can attach Application URLs to a specific controller action by using Routing. If you want to change any url path, then you need to change in one file “Routes->web.php” file.
4. Eloquent ORM (object-relational mapping): One thing important about laravel is Eloquent ORM. By using Eloquent ORM, developers can easily interact with a database. ORM provides a Active Record implementation that means each “table” corresponds to one model(App->Model).
For example: a “user” model(App->Model->User) will correspond to “users” table in your database, so you can easily get all users data by writing one line/query:
5. Libraries: Laravel has “Object Oriented“ and “Pre-installed” libraries which are not available in any other PHP frameworks. One of the “Pre-installed” libraries is “Authentication” library. We can easily use this library to make our application more secure. It has many features, such as
A. You can check currently logged-in users on your website.
B. It provides “Bcrypt Hashing:” which means “password” is stored in encrypted form in your database, so no one can hack your password.
C.”Password Reset”, you can reset your password easily by using this library.
6. Entirely new directory structure: The directory Structure of laravel is very simple in which, all database migration, configuration, storage, view and routes files have a specific folder. For example:
a.) .database -> This folder contains your database migration and seeds.
b.) .config -> This folder contains all your configuration files.
c.) .resources -> All view files of your application are created in this folder.
d.) .routes ->You can define all routes for connecting your Application URLs with a specific controller action or view in this folder.
7. Pagination: Pagination is very useful feature in laravel. In other frameworks, it is very difficult to manage pagination. You can use pagination with query-builder and Eloquent ORM. Laravel generates clever “range” of links based on current page. For example,if you want to display only 15 users per page,then you can use paginate method with your query i.e.
$users = DB::table(‘users’)->paginate(15);
8. Routing cache feature: This feature speeds up the application route registration. If your application has large number of routes then this feature is very helpful. All changes of your application routes do not take effect if routing cache is turned on.This is generally implemented as a part of the deployment process. You can turn ON/OFF by typing following commands on the terminal:
A. “PHP artisan route: cache”: It is used to turn ON the routing cache.
B. “PHP artisan route: cache”: It is used to turn OFF the routing cache