Why Laravel?

Well, before we can answer that question, lets start with РWhat is Laravel? Laravel is a free, open source, PHP Framework, made for use by web application developers to speed up development and handle some of the repetitive tasks involved.

The Architecture

Laravel uses a beautiful MVC (Model РView РController) architectural pattern, and though slightly confusing to begin with you may Рmuch like I did, come to love it. 

For those who have never used an MVC architecture before you’ll especially find it tricky to begin with, and may sometimes get lost within what feels life an infinite maze of directories that Laravel has.

However, this maze quickly becomes home and you’ll be able to traverse it blind folded given a small amount of time. In fact, Laravel’s once perplexing filing system soon makes sense, you realise how it has all been carefully categorised for efficiency.

And that’s it! Once you’ve jumped over that learning curve you’ll be sprinting through the maze, knowing it as well as the back of your hand. The Laravel architecture soon becomes very efficient and tidy. I look back and I can’t imagine not using this MVC style system now.

The Back-end

But with Laravel this maze is a necessary evil, because hidden away within that maze are the files that handle the back-end, from the “Blade” feature to the “Artisan” commands.

These are the primary features of Laravel, the libraries that can do some of the heavy lifting for you. For instance, the Artisan library is a command-line tool that comes with many functions to improve your efficiency.

php artisan serve

The above command is used to start the local development environment that comes with Laravel. Other commands allow you to do things such as set and clear caches and view routes created.

What is MVC?

Though there is some debate on if Laravel really uses and MVC design pattern we’ll keep it simple and say it does. Well in that case what is MVC? Simply put MVC is a type of architecture, it seperates what the user sees from the logic.

The Modal handles the data of the system. In the case of Laravel we use it to connect to specific tables in our database.

The View is the UI of our application. This is what data is displayed to the user.

The controller is the middle-man between the view and the model. The controller handles data sent from the view to be stored in the modal.

The following image from Wikipedia is a perfect example of how MVC works:

To conclude, I’ve been working with Laravel for some time now and would strongly recommend this as a refreshing framework for PHP developers to work with.

Written by Rhys McClew

Why not check out my other posts? Or even learn a little more about me and go to the About Me page.

An image of Rhys McClew

Next Post

Previous Post

Leave a Reply

© 2020 Rhys McClew

Theme by Anders Norén