Today's article devoted to creating a site from scratch on What is Laravel 5 in PHP? which will describe all the basic designs of this web framework, and in the end, you will receive a fully functional resource.
These what is laravel 5? An important key features of laravel? Lessons will help me to better understand the structure of the engine and consolidate my knowledge once again with the help of practice.
You, by the way, are waiting for this, too. The best way to learn something is to do it yourself
And in this introductory article, I would like to introduce you to the Laravel 5 framework and its important key features of Laravel in more detail, as well as to the Laravel API, so that you understand exactly what it has under the hood and interest you in its study.
Key Points What We Learn Today In Laravel 5
Who should try the Laravel framework?
What Is Laravel
18 Most important key features of the Laravel Framework
Examples of Laravel sites
At last about Laravel PHP framework
Who should try the Laravel framework?
Before we begin, I would like to tell in a few words, for which this article is intended.
First of all, it, of course, will be of interest to my fellow developers or to those who plan to become one, since A framework is a tool for a professional programmer.
If you do not treat these as such, then do not waste your time; many things will still be incomprehensible to you.
For web-developer, this material, as well as the whole cycle of subsequent articles, will be simply necessary, because Must have the ability to work with the framework, if you care about your professional and career growth.
I hope I slightly motivated you? Then let's go
What Is Laravel
For those who do not know, and do not know what Laravel is, first I'll briefly say in brief about this site framework.
So, Laravel is a free PHP general-purpose framework with open source, which was born relatively recently - in 2011, but thanks to the rapid development and huge army of fans, nowadays it was the most well-known PHP framework
The creators of Laravel named it "framework for artisans", which in translation means "framework for artisans", hinting that this platform gives developers complete freedom of creativity, without creating before them any obstacles in the development process.
As early as the end of 2013 Laravel had version 4.1 and was named "the most promising project for 2014" by sitepoint.com version.
By the way, for today the current version of the framework is 5.4, the development of a site on which I will describe in future articles of the cycle.
And in 2015 and 2016 it was recognized as the most popular PHP framework by the version of the same publication - sitepoint.com, which annually conducts a survey among thousands of developers around the world
So, what about Laravel "under the hood" and what did he gain such unconditional popularity among the developers?
18 most important key features of the Laravel framework?
Laravel is a PHP framework, which means that it is written in the PHP programming language and you can also create code on its base only in PHP.
In general, this is normal behavior for PHP engines (Yii, Symfony, Zend), but as you know, there are exceptions in the form of Phalcon, in which the components are written in C ++, and the user code is written in PHP.
That's why I decided to pay attention to this moment.
So, what's interesting about the Laravel developer?
Informative documentation
I decided to start with the 18 most important key features of Laravel, which all developers inevitably encounter when mastering a new technology.
This documentation Laravel, which in my opinion, is very good and structured.
Read - Which Is The Best Open Source CMS Platform 2018
I think that this also adds popularity to this engine among developers. At least in my case it's true
It was especially nice to study Laravel docs after trying to make friends with Yii2, whose manuals are some kind of continuous story about creating a site based on the framework with individual references to some of the designs and principles of their work.
In Laravel documentation there are no such problems - each article and process is devoted to each design and process.
Because this PHP framework has a mass of followers all over the world, you can find many different communities and user translations of articles on the network.
Laravel documentation in World exists even in several versions on the sites laravel.com laravel-china.org laravel.ru
MVC code structure
The structure of the Laravel framework code corresponds to the popular MVC design pattern, i.e. In it, you can select models, views and controllers.
This design pattern has established itself as a time-tested solution to the effective application structure, primarily in the web, allowing you to separate the application logic from its visual part.
MVC allows you to make the code more readable, and the development process is comfortable, delimiting the work of frontend and backend developers.
Artisan
Artisan is a console Laravel, in the arsenal of commands which is working with migrations, controllers and models, authorization and other basic components of the framework.
Migrations
Some kind of version control for the structure of the database tables. Each migration file contains either a table structure or a structure change.
That process of creating new database entities in the Laravel framework is the creation of a migration and launching it using special console commands artisan.
Example of creating a table of site users in the corresponding migration:
Also in the engine, there are many methods for manipulating migrations: rollback of the individual, resetting all, etc.
Blade
Blade is your own template with a set of directives. The principle of his work is similar to most of his fellow men - Smarty, Twig, etc. So if you worked with any of them, then in the know what it is.
Honestly, I still do not quite understand the usefulness of using templating. And even more so, I do not understand why the Laravel team needed to invent another bicycle, if they already had enough of it.
Twitter Bootstrap and jQuery out of the box
After the Laravel framework is installed, the app.js and app.css files are available to the developer, which are composed and minimized jQuery and BootStrap of the latest versions at the time of the release of the Laravel release.
So to connect them manually again does not make sense. If you, of course, arrange such use of these packages and you do not prefer to use any package builders, for example, WebPack.
To work with him in the Laravel framework, by the way, there is a special tool.
Laravel Mix
This package is an add-on for the mentioned WebPack, which allows you to separate css and js code into separate modules, configure their use, configure the minisation and use css preprocessors (sass, less, stylus, etc.).
In general, the front-end developers will appreciate
Registration and authentication
Out of the box, Laravel provides a mechanism for registering and authorizing users, which makes life easier for developers, allowing them not to invent the next bikes.
Validators
Remember the times when you wrote in pure PHP and made a check for the existence in the database of the value entered from the form, by manually querying the database to avoid duplicating it.
In truth, at first, when I first started working with Laravel, I did the same, because I did not know about the existence and appointment of validators.
Laravel validators are structures that allow you to validate data based on various ready-made rules. Also, Laravel allows you to create your own rules, error messages and custom validators in general.
Eloquent ORM
ORM is a programming technology that is designed to make it easier for programmers to work with databases by providing API methods for typical operations (sampling, adding, updating, deleting, etc.).
There are a lot of ORM implementations, but the creators of Laravel were confused by making up their own.
Queuing
In Laravel, tools for organizing process queues are available from the box (for example, for mass email sending).
This function is indispensable for High Load-projects because It allows unloading the server from a permanent job.
Interface for Cron tasks
Laravel provides a set of methods for creating and managing tasks that are performed using the Cron task scheduler.
An example of a task with execution every hour in the interval between 7 and 22 pm:
Convenient code debugging and testing
It is implemented by the presence of the debug panel, a special function dd () for displaying the data on the screen (analog of the PHP-design echo '<pre>'; print_r ($ var); die (); ) and the detailed log of the application.
As for testing, in Laravel, the mechanism for writing unit tests using the popular PHP Unit testing framework is available from the box.
In addition, in the process of testing the health of resources in the Laravel framework, there is the possibility of emulating site page visits and various actions (clicking on links, buttons, text input, etc.) through the use of Symfony components.
Ability to extend the basic functionality
Since the framework is just a set of tools for efficient code writing, all the banal functions that are added to the CMS in two counts by installing ready-made modules, in case of using frameworks, each time you write with your hands.
To avoid this routine work, Laravel developers introduced the possibility of extending the functionality of the base application by installing packages that are analogous to modules for CMS.
Caching out of the box
Another useful Key feature Caching out of the box without which it is impossible to develop a full High Load-resource. Moreover, caching in Laravel is available through various technologies: Redis, MemCached, etc.
using the appropriate drivers and packages. By default, the file caching driver is available, thanks to which the cached information will be stored in the file system.
Convenient mechanism of routing
Manipulation of the URLs available on the site in Laravel is incredibly simple and convenient. All you need to do to add Laravel 5 routes is to edit the routes / web.php file. The simplest addition of a new route is as follows:
Code
This rule will display the contents of the resources/views / welcome.blade.php file when you go to the root of the site.
Read - C++ Introduction And Tutorial For Beginners
Also for routs, it is possible to specify the methods of controllers and user functions, applying to them MiddleWare - another Laravel chip, which is a layer between the router and the action when it is executed.
Working with sessions in various ways
As you know, session objects are stored on the server, therefore, they can easily and conveniently manipulate the server programming languages, as well as assign different storages to them.
This feature was decided to take advantage of Laravel developers, having implemented in the framework the choice of a way of storing session objects using various technologies
file storage on the server - standard session objects;
- cookie;
- Memcached;
- Redis;
- saving data to the database;
- temporary PHP array.
Laracon
The last of the important key features Laravel, which I would like to talk about today, is not thematic, but, nevertheless, also worthy of attention.
Laracon is a thematic conference aimed at bringing together lovers of Laravel from around the world to share their experiences.
It is held several times a year, beginning in 2013, and, in different parts of the globe. And in this, in 2017, it will be held for the first time in the online format.
Examples of Laravel Sites
At the end of an express meeting with Laravel and to confirm my words, I prepared a small collection of sites developed on the Laravel framework so you can see what can be achieved in studying this framework:
neighborhoodlender.com- Multilingual Landing
stichoza.com - LANDING WITH VOYAGE CONTROL
laravel-tricks.com – The Laravel tricks websites
laracasts.com - portal dedicated to Laravel, having its own forum
www.exploregeorgia.org - business card site
fox47.com - news portal
Meanwhile, the possibility of developing non-standard solutions is the main feature of Laravel and frameworks in general, which distinguishes them from CMS.
Therefore, I next offer you a list of Laravel projects that have no analogs among existing sites:
At last about Laravel PHP framework
Of course, the list of important key Laravel features I have given is far from complete. But, I hope, it was enough to arouse your interest in studying this framework
If the arguments seem not enough, then it is enough to recall the popularity of the Laravel framework, which, in turn, leads to an increase in the demand for relevant specialists.
And, as my recent mini-research of the PHP developer services market showed, this trend is already observed both in the CIS and around the world.
So, studying the Laravel framework is a promising occupation from all points of view: from the positions of professional growth, and career.
I think briefly describe and also you understand this topic What is Laravel 5 in PHP And Its Most Important Key Features in Laravel
I'll say to myself that I got motivated from the first days of working with him - so much for me this framework fell in love.
Probably, because "his logic coincides with my own," as one of my fellow programmers at a forum said.
So, we examined the most interesting and significant buns Laravel 5.
And more in detail with each of them I will introduce you in the subsequent publications of the cycle on creating sites on Laravel 5 from scratch, which I solemnly opened today's article.
I hope that it turned out and did not let you get bored.
Write your feedback and comments in the comments box, and do not forget to share the record with your friends on social networks, and also to create them on the site of Laravel.
0 Comments
Post a Comment