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

MostofaL's avatar

Want to read Laravel source, don't know Where to start! Any Tips?

My Goal: finding a deeper understanding of how Laravel works. (Thus, becoming more capable and writing better codes.)

More details about me and the question:

I'm a 30 years old junior backend developer and I have one year of experience with Laravel.

In my pursuit of expertise, I've done the following so far:

  • Tried to Make my own MVC framework with php ( following this course on youtube: https://youtube.com/playlist?list=PLLQuc_7jk__Uk_QnJMPndbdKECcTEwTA1 )
  • I've got Familiar with Design Patterns. -I've read about how and where Laravel uses these design patterns ( mostly by reading a book called design patterns in Laravel and watching some Laracon talks on the matter).
  • Got Familiar with Clean Code, and Refactoring (generally).

I was wondering what would be a good next step for me.

I'm sure reading Source codes would be a great way of learning. is there any step-by-step guide maybe? especially on reading the Laravel source code itself.

Any tips or advice?

0 likes
11 replies
Nabaasa's avatar
Nabaasa
Best Answer
Level 5

My solution to understanding how laravel works behind the scenes has been;

  • Many throw away projects, by doing this i usually find my self googling stuff, but also looking for methods to call on objects so i usually go to the vendor file to look for available methods. This helps me, not only read the laravel source, but also code from other packages. Super helpful
  • The other super helpful thing is to read thru the pull requests on github in the project, https://github.com/laravel/framework/pulls. Guaranteed, at first, things are kinda tricky to understand but with time, you start understanding
  • The other point that cant be overlooked is following people in the laravel community on twitter, the likes of Aron Francis, Jeffrey Way, Taylor himself, Caleb Porzio, Freek Van der Herten, etc, there are so many smart people in the community that are worth following - basically getting immersed in what these guys are talking about
  • The other thing is visiting the laravel news site occasionally - helps a lot too
  • Also, you cannot underestimate the power of laravel docs, i personally usually read the docs ahead of time, ie, in my free time, i just check them out - the docs are my bible
2 likes
MostofaL's avatar

@Nabaasa fantastic. Could you maybe elaborate a bit more on your first suggestion?

Nabaasa's avatar

@mostafaalotfi@gmail.com basically on my first point I meant working on as many Laravel projects as you can, aiming at learning. that was you'll find challenging tasks that will force you to look for solutions & by doing so you'll find yourself reading the source code of the framework & of the any packages you might have added

1 like
laracastsluvr's avatar

Laravel is a large and complex framework. Start small and work your way through every component offered by default. eg. HTTP client, Routing, etc

Age should't matter, I started 3 years ago at 35 :)

1 like
cwhite's avatar

Start at the entrypoint and work your way down the rabbit hole

1 like
jlrdw's avatar

Lookup what you need in the API:

https://laravel.com/api/10.x/

An example, laravel uses many symfony components which in turn uses normal php. These you find from the use statements in framework

As example behind the scenes, a file upload uses the normal move_uploaded_file.

https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/HttpFoundation/File/UploadedFile.php#L172

https://www.php.net/manual/en/function.move-uploaded-file.php

The shortcuts in laravel is running pure php in the background.

Blade also converts to php.

Eloquent converts to normal sql at runtime.

1 like
Danakin's avatar

Instead of just reading the Laravel source, I find it useful to follow a specific rabbit hole deeper and deeper.

For example, the other day, a client wanted to use temporary signed route, but wanted the response to an invalid signed url be different from the default signed route middleware. Basically, they wanted to throw the standard 403 error when some part of the url changed, but wanted to show a "request another link" page when the timestamp expired.

So I followed the rabbit hole: How is a url actually signed? What makes it different from a temporary signed url? How does the signed middleware work, and how does it check if the url is invalid? How does it check that the date expired? How do those checks work under the hood (for example, whats happening in $request->hasValidSignature())?

1 like
MostofaL's avatar

@Danakin thanks for sharing your experience. examples were really useful.

1 like
beghelli's avatar

hey Mostofal, I've been doing that for a couple of weeks now. I started from the entry point (the index.php) and just followed the code execution. Any time some new class is used I try to understand what the class is representing, its use cases, do some testing, etc. It is slow but fun to discover how and why things were built in a certain way. I'm documenting that on youtube, if you want to follow and share some experience, channel link is here.

Please or to participate in this conversation.