Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Garet's avatar
Level 3

Learning Laravel and feeling overwhelmed

A little bit of background, I’ve been developing in PHP for the best part of 15 years. I started with standard procedural code and worked my way onto object orientation.

For the last 5 years or so I’ve been using the CodeIgniter 3 framework, which I absolutely love. I’ve built a number of applications with CI in rapid time and enjoyed every moment of it. However, the thing that has niggled in the back of my mind is that CodeIgniter is not well regarded any longer – some might say it’s deprecated or obsolete, and it seems nearly everyone uses Laravel.

So I’ve taken the plunge and decided to learn Laravel. How difficult can it be when I have a pretty good understanding of PHP and another MVC framework? The answer, for me at least, is incredibly difficult.

I’ve read through the documentation and created the two example Task apps (beginner and intermediate). I’m now creating my own simple app for storing customers and customer interests. I’m adding authentication and authorization (permissions) to the app now.

But my god, I’m finding it to be the equivalent of trying to push water uphill. Right away I can see how flexible routing is in Laravel, as well as the ability to define relationships between models, and a few other things which look genuinely useful/helpful. But then I just run into one issue after another. Some of the problems I face:

  1. Naming conventions - OK – this is a minor gripe, but I come from a background where things are called controllers, models, views, templates, helpers, libraries, etc. In Laravel we have names like Eloquent, Facade, Blade, etc. It’s not a deal breaker, but the weird and wonderful names don’t particularly help with the learning curve.

  2. What to use when - In Laravel there are service providers, middleware, the kernel and other things I’m not too familiar with. I find myself constantly scratching my head what I need to use and where. For example, I want get the name of the current controller class and method, put them in two separate variables and share them across all views. So I extend the BaseController and do it in the constructor. This works fine, but it doesn’t seem to be the “correct” way. So I create a Service Provider instead, however I can’t seem to get details of the current Route in a Service Provider (it returns null), so then I create a Middleware and do it that way. After some 2 hours I have the concept working, but when I look at tutorials online they often use a completely different method which just boggles my mind.

  3. Confusing code – For example if I don’t want to do cascade deletes on relationships in my database, when deleting a customer I’ll first want to delete all of their interests, so I’m doing this in my Customer controller:

    public static function boot() {
        parent::boot();
        static::deleting(function($customer) {
            $customer->interests()->delete();
        });
    }

OK it works, but it took me a long time to figure this out. Originally I was just creating my own delete() method in my controller thinking this would just extend/override the delete() method of the main Eloquent Model, but it didn’t work.

  1. Blade – OK I get that doing {{ $someVar }} means we don’t have to echo using htmlentities() but apart from that, Blade seems to be just re-inventing PHP (I never have been too keen on templating engines). I know you don’t HAVE to use Blade, but it seems like everyone else is, and again I feel frustrated that I can’t really get my head around why it is better.

So this isn’t a rant. I know it sounds like one, but I’m frustrated with myself more than anything else for finding this so damn difficult. Furthermore, when I look around for confirmation that I’m not the only one, all I can find are positive remarks about Laravel and how it’s changed every developer’s life for the better, further making me feel like some kind of weird outsider.

Did anyone else ever feel this way? Am I really the only one? Is it a case of just whittling away at it for hours on end and it becomes easier? Any tips or helpful words of wisdom to encourage me to battle on?

Thanks in advance!

0 likes
5 replies
ederson's avatar

The service provider thing is not very clear to me too. I ve read everything but I still can't get it.

But other than that I've found most things make perfect sense. My code is much better organised and readable.

The videos here are great help too.

jlrdw's avatar

Nothing in laravel is forced on you.

You do not have to use blade you do not have to use the orm etc.

Go ahead and play with that orm.

Set up a nested for each where one company might have two or three receivables but another company has thousands of receivables.

You will probably go back to regular queries, for this sort of thing.

I use it for simple relations but if it's more complex thing I write a regular query.

On things where I don't use blade I use strip tags for everything..

You have to remember here you are on a laravel forum, so of course things in laravel are going to be highly pushed and preached.

Try a cakephp forum, there cake will be better, a codeigniter forum well codeigniter will be better.

In actuality laravel, yii2, and Cake PHP are all three very similar.

And that orm code it's converted to regular SQL at runtime.

Makes it extremely difficult to customize in a framework if you ever have to convert to another framework.

Normal PDO with proper bindings can be easily converted between any of the Frameworks.

Edit: the main reason I like laravel is its flexibility, Taylor Made it extremely flexible to use.

You can even use another DB wrapper if you wish.

I actually did this once while converting code to query Builder of course once done I did not use my other DB wrapper anymore.

steve_laracasts's avatar

I know how you feel, you're not weird, it does just take time and lots of practice.

The reality is there are many ways to do the same things, or lots of different tools to help you get the job done which is what makes it so confusing at first.

Which tool you use depends not only on which tool is best for the job, but the list of tools you know about and I totally appreciate that Laravel offers a lot of 'new' tools. Ultimately it will come down to just a matter of personal preference.

Just keep going, one day soon you will look back and start to see how your life has changed for the better just like others have claimed before you.

Garet's avatar
Level 3

I just thought I would update this thread several months on.

I've now built two projects with Laravel and I absolutely love it. It has been a huge learning curve but eventually all the pieces of the puzzle fit together. The other thing I've learnt is that there are often multiple ways to skin a cat, so personal preference often comes into play.

Eloquent is absolutely brilliant in terms of dealing with collections and not having to write your own queries, loops and manually create objects and multi-dimensional arrays. My only concern is whether queries could sometime be more optimal, and I feel because Eloquent hides much of what's going on under the hood, you're never quite sure. I saw in one of the tutorial videos the use of Telescope which I guess might help with this.

I sometimes run into confusion between Eloquent and Query Builder, and end up scratching my head when a method is available in one and not the other. I also still struggle to get to grips with when to use parentheses and when not to, and I find out by trial and error rather than having a solid understanding of when to use them and when not to.

But overall I'm glad I stuck at it and eventually saw the light. Thanks to everyone that offered encouragement!

1 like

Please or to participate in this conversation.