Laravel

Laravel Introduction

January 30, 2018

author:

Laravel Introduction

# What is Laravel?

Laravel, created by Taylor Otwell, is a modern web application MVC framework. It is the most popular open-source framework for PHP. It is highly inspired by other frameworks like Ruby on Rails, ASP.NET MVC, CodeIgniter and Sinatra. Since it only extracts the best from these frameworks, Laravel is emerging as one of the powerful and massive languages of this era.

Laravel proposes less coding time and more development utility for bringing the applications together neatly. It aims at making the life of developers easy by providing ready-to-use common tasks like authentication, routing, caching, etc. It provides a strong and secured foundation for projects of any scale. It also has a large community of contributing, ready-to-help developers with numerous libraries and packages.

Learning Laravel can be a cakewalk for developers and aspirants familiar with PHP language and its advance usages.

# What is MVC?

MVC is an architectural structure that many frameworks implement. (Laravel being one of them!). It is a three logical leg-tool:
• M – Model
• V – View
• C – Controller

Each of these element performs a special function in application’s request-response life-cycle and are bundled together tightly.

It helps us create re-usable chunks of code, thus building a scalable structured programming. Maintenance and re-building any application becomes a lot easier too.

Let us now see each of this components separately:

• Model

It is the business layer of the paradigm. Model is also known as data repository of the MVC architecture. It consists of the logical structure of data. MVC Model represents the data that is usually exchanged between View and Controller. It may be a full-fledged database or a simple excel sheet.

• View

View is the layer that user interacts with. It displays data on the screen. MVC View represents all the visible components on the screen that a user can respond to. Hence it depicts the User Interface of the application.

• Controller

Controller represents Application layer in MVC. It connects the other two layers (Model and View). The controller serves as a means of communication between the database and user interface. It receives a request from the user (via View), processes it and sends the relevant data (from Model) back.

Fortunately, Laravel doesn’t have any fancy names for each of these elements. They are called Model, View and Controller just as their meaning suggests above.

# Features of Laravel

Laravel has a wide variety of features which are available out-of-the-box for instant implementation. Let ‘s have a quick look at some of them:

• Artisan

It serves as an assistant for your Laravel projects. It is a command-line tool bundled with Laravel which can perform plenty of helpful commands.

• Routing

It is the URI route system in Laravel. HTTP routes can be mentioned in an elegant and meaningful way. Laravel also provides required security for phishing control with the help of CSRF Token.

• Config Management

Managing database connections or server ports isn’t cumbersome anymore. Laravel provides a simple and lucid way for these.

• Migrations and Seeding Database

Migration stores the database schema in a file structure. This makes updating (removing/adding fields) super easy. Laravel Migration also has an ad-on feature which is database version control. Laravel also supports seeding the database with data.

• ORM (Object Relational Mapper)

Laravel provides this robust feature which gives pleasant experience while working with a database. It simplifies the database queries.

• Blade Template Engine

Blade is a lightweight templating language by Laravel. It is so powerful, yet easy to learn. It’s syntax to write PHP and HTML together and using it as a template makes its usage multi-purpose and dynamic.

• Mail Support

Laravel makes drafting and sending mails easy as never before. It provides ready-to-use drivers for SMTP, SparkPost, Amazon SES, Mailgun, etc.

• Authentication and Password Recovery

Laravel can set up both Authentication and Password Recovery functionality with the help of a single artisan command. (Yes you read that right!)

• Redis Support

Laravel supports Redis, an open-source data-structure which stores data in a key-value pair. It provides an interface for publish-subscribe service.

• Command and Event support for Automation

User-defined commands and events can be created for conditional and automated tasks in Laravel.

• Security

Laravel has some in-built security features. It uses Bycrypt Hash Algorithm to create encrypted passwords and is hashed(#) before saving in the database. Also, SQL statements used by Laravel makes injection attacks impossible.

Parting Thoughts:

We just discussed some basics of Laravel starting from the primary question – What is Laravel? We expanded our knowledge about MVC Architecture and discussed some features of Laravel. Lately, a new version 5.6 was released. You can also check the new features of Laravel 5.6.

Leave a comment

Your email address will not be published. Required fields are marked *