So you've kind of heard about Laravel. You're maybe considering learning it, but there are just too many things to take into account. Tinker? Artisan? Composer? Why does everything sound like character classes in an RPG game?
This is by far no definitive guide, but if you've ever asked yourself “why should I bother with all this stuff”, read on for some of the most asked questions when starting out with Laravel.
What is Laravel and why it is used?
Laravel is an open-source PHP framework designed to make developing web apps easier and faster through built-in features. These features are part of what makes Laravel so widely used by web developers:
A modular packaging system with dependency management. This means you can easily add functionalities to your Laravel app without writing them from scratch. You can either create your own packages for code you routinely use or install ready-to-use packages through Composer.
A complete authentication system
Object-relational mapping. Eloquent ORM included with Laravel presents database tables as classes for easier data access and manipulation.
A command-line interface (CLI) that comes with dozens of pre-built commands (Artisan).
Automatic testing. Automated tests are provided as an integral part of Laravel.
A portable, virtual development environment. Homestead provides developers with all the tools necessary to develop Laravel straight out of the box.
Is Laravel frontend or backend?
The short answer is “backend”. The long one: Laravel is a server-side PHP framework; with it you can build full-stack apps, meaning apps with features typically requiring a backend, such as user accounts, exports, order management, etc.
Source: https://blog.toggl.com/lightbulb-cartoon-developers/
What is MVC in PHP Laravel?
MVC (Model-View-Controller) is an architectural pattern used to break down an app into three fundamental parts: data (Model), an interface to view and modify data (View) and operations that can be performed on the data (Controller).
Think of it as ordering a pizza. You call with a user request for Pepperoni pizza. As soon as your request is registered, the person who makes the pizza (the Controller) deconstructs it into a series of steps: grab the dough, fire up the oven, sprinkle the grated cheese. The Controller can only use the limited resources it has at his disposal, this limited toolset being the Model: hands, oven, pizza tray, etc. Finally, you receive the pizza, which is a wonderful View.
This way of structuring an app is useful because it keeps things separated into logical areas. This makes your code more organized, less fragile and easier to debug. Laravel implements MVC architecture as part of its design.
Can I learn Laravel without PHP?
Laravel is PHP at its core, so learning Laravel without having a good grasp of PHP is not very productive. You will not be able to create additional functionalities and you will be completely dependent on the ones Laravel ships as part of the framework. The bottom line, you need PHP and OOP concepts to understand what's going on under the hood and to use Laravel to its full potential.
Is Laravel easy to learn? What is the best way to learn Laravel?
Laravel is considered to have a short learning curve, especially if you're already familiar with PHP. Even when stuck, the community is really helpful and there are a plethora of resources to help you learn Laravel from scratch, from podcasts and videos to written tutorials.
A good way to learn Laravel is to read the documentation, follow some of the gurus online, such as Taylor Otwell, Jeffrey Way and Freek Van der Herten, go through the tutorials out there and follow along. Finally, start building your own project and google things as you go.
Is Laravel a CMS?
Unlike CMS's like Drupal or Wordpress, Laravel gives you full control over your application. In Laravel everything is done in code, unlike Drupal or Joomla, for example, where you can create functional websites without writing a single line of code or without even knowing what PHP is.
Simply put, a CMS is an app that comes with basic functionalities and is built on top of a framework. Laravel is a framework and it’s used to build apps, including CMS platforms.
Now what?
While there's no shortcut for learning anything, especially programming, there are ways of making it worthwhile. You don't need to become a Laravel guru overnight. Don't stress over learning every component by heart before you can start writing code. Experiment, try things out and learn one new thing every day.
Top comments (20)
Laravel is to PHP as ? Is to nodejs?
I would say expressjs
Pretty much, have you had any experience with it
Would have said AdonisJS
Oh right, I feel like a noob now lol
No man don't 😂 you know, there is so much tools out there, you can't catch up with anything 😁
Lol I try to, I do more of front-end, trying to be full stack though
NestJS is the equivalent when it comes to all encompassing framework that adds functionality/tooling/developer experience for Node.js.
AdonisJs by far ;)
AdonisJS
AdonisJS is probably the closest.
I disagree with this line a little... Drupal gives you complete control over your application. It's not a CMS in the traditional "Wordpress" sense, it's a CMF - Content Management Framework. With Drupal you can build a CMS, but out of the box it's a CMF, which needs work to get it to a "Wordpress" state. This makes it very powerful in that you're not stuck being a "Wordpress" site. Drupal is a tool for building a Content Management System for a variety of different needs.
It's actually a CMS according to their website.
I would say you haven't been using Drupal too much. They are using the term CMS as it is widely recognized, but in the matter of fact it is a system in which you tailor custom made CMS according to your client very specific business logic. Precisely it is a combination of CMS and Web Application Framework, what +/- makes it CMF.
I think this short article is worth reading.
cheekymonkeymedia.ca/blog/drupal-c...
Both Laravel and Symfony are viable choices when we want to write PHP applications that don't place your users in immediate danger. I think it says enough.
That being said, you can still wreak a substantial amount of havoc with them.
Yep, Laravel is pretty good, it uses the MVC architecture. OctoberCMS is based on Laravel which is also a great alternative to WordPress if you're looking to move away from it.
The article provides a great overview of Laravel, particularly for those who might be intimidated by all the technical jargon. The pizza analogy for MVC is spot on! It's so important to break down these concepts into relatable terms. The emphasis on learning PHP and OOP before diving deep into Laravel is crucial advice. Overall, this is a valuable resource for anyone starting their Laravel journey.
Speaking of Laravel, my colleague Guilherme recently wrote an in-depth review of Laravel 11 that you might find interesting. He dives into the new features, improvements, and considerations for upgrading. Check it out here: scalablepath.com/php/laravel-11
I think you might find this really useful!
It's daddy's work thing, please leave it alone.
Come back after your PHP exam.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.