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

martinszeltins's avatar

What are Laravel packages and can they be used independently?

Exploring Laravel's source code, one can notice that everything in Laravel is a package. Go ahead, open up vendor/laravel/framework/src/Illuminate and you will see these directories, each being a separate package.

Auth (illuminate/auth)
Broadcasting (illuminate/broadcasting)
Bus (illuminate/bus)
Cache (illuminate/cache)
Http (illuminate/http)

All of these can be installed separately using composer require illuminate/http for example.

That makes one curious - what is the purpose of this? Why is everything separated into their own packages? Does that mean they can be used independently outside of Laravel (just like Symfony Components)?

You will also notice that there is another directory called Foundation (vendor/laravel/framework/src/Illuminate/Foundation) - and this one does not have a composer.json file inside of it - it's not a package like the others. What's going on here? It seems that this is the actual Laravel framework that is using the other packages.

Any thoughts on this? Maybe someone has a better understanding on how this all works?

0 likes
5 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@martinszeltins Each component has a seperate folder which you can go into, to see how to use that illuminate component outside laravel

At the moment, the project is divided into many directories beneath components which will each contain an index file, usually written with Slim. Navigate to that directory in your terminal and run the following to serve a web site from that directory:

So lets say you want to use cache. You can then see an example of how it works here: https://github.com/mattstauffer/Torch/tree/master/components/cache

And you can download (or git clone) that directory and run composer install etc. to test it.. Or just check the composer.json and index.php to see how it should be done :)

1 like

Please or to participate in this conversation.