Laravel, a fast and powerfull framework for PHP developing

in #programming7 years ago

Laravel is a powerful PHP framework developed by Taylor Otwell that allows to create web applications faster without decreasing its security. It’s based on the MVC pattern (Model – View - Controller) where controllers are classes. So that, a controller has lots of public methods that are the entry point of a HTTP Request of your app.
This framework has lots of advantages when developing. It allows you to configure the environment of your application in a single file called .env. Here you can configure database connections, the email of your application and even switch between debug and production mode.

And if this is not enough for you, then in config folder you can find a lot more configurations for your app, from basics to filesystems and views.

Also Laravel has Eloquent ORM, but first, let me explain what ORM means. it’s Object-Relational Mapping, and it’s a programming technique that allows you to make database request using an object oriented language, making queries such as innerjoins and leftjoins more easier.
Even though, my favorite feature of this framework is its template system, Laravel uses Blade, which is really intuitive and easy to use. This makes your views code more elegant because it prevents from using PHP tags in your HTML code. I mean, if you want to make an “ if “ sentence you only have to write “ @if(coditional) – HTML Code -- @endif “ and that’s it. This makes your HTML code cleaner, but far beyond of just a simple visual feature, this templates can reduce code by reusing it, and you can create sections called “partials” and adding then into your view.
Maybe at this point you’re wondering, how do I install Laravel? Well, is really simple, first you have to install PHP on 5.6.4 version or further and install Composer that is a dependency manager. In case installing PHP turn to be a pain in the neck, then you can install XAMPP, this software comes with PHP, MySQL, FileZilla, Mercury and Tomcat.
After XAMPP being installed, you should go to your webserver folder (I’m using XAMPP), so XAMPP by default is installed in the root folder of your C drive, then you have to go through the folder in the command prompt. Here are the steps:
When you open command prompt you will find something like this (In case you are using Windows):

Type “ cd / ” to go to the root folder.

As you can see now you are in the root folder of your C drive.
So now you have to look for XAMPP folder, but, How do I know what folders are in this folder? Simple, you type “dir” on your command prompt and will appear all your folders.

And then we look for XAMPP.

Then, to go into that folder just type “ cd XAMPP ”.

And then you have to go into htdocs, so type “cd htdocs ”.

To make your first project you have to use the next command “composer create-project laravel/laravel 'Application name' 'Version' --prefer-dist” (In case you don’t type the number version it will take by default the last one). So, for this example I will use the next command “composer create-project laravel/laravel myFirstApp –prefer-dist”.

Now all dependencies are downloaded. If you want to know is your project is ready for developing you have to go to your project folder and type “ php artisan serve ”.

Type that URL (http://127.0.0.1:8000) in your web browser, and this should appear.

Now you’re ready to go. Your Laravel project is ready.
For more information visit http://laravel.com