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

LexianDEV's avatar

How to make Plugins for your Laravel app

Hello, I have a big project idea, it is a very big idea, basically, a project that can be expanded upon with custom functionality...

The project will start with a framework, I am using Laravel, but the app itself will be the foundation for expansion, I want to allow people to create and expand upon my project, all within one branch, otherwise known as Plugins.

So, I wanted to ask, does Laravel offer a way to implement plugins, or is there a composer package that can load plugins?

How i imagine plugins working: Basically, the plugins are loaded in a plugins folder somewhere in the project, and then it loads the class for the plugin and it can then extend it's own class and add functionality, for example, maybe it can extend the routes, or add options to the navbar. I'd love to do this if it's possible!

1 like
8 replies
LexianDEV's avatar

@vincent15000 I could do composer packages, but I'm thinking more like, you go into my app's files and in app\Plugins you can see a bunch of third party plugins which interact with Laravel and expand upon it, but in a way that doesn't modify the codebase.

1 like
LexianDEV's avatar

@jaseofspades88 Indeed that does seem to be the answer, however the packages would be quite curated to my specific app, I'd like to ensure people don't just download it and it breaks their codebase. Do you know if there's any way to ensure people know it's not a standard laravel package?

1 like
martinbean's avatar

@LexianDEV I don’t really understand the problem? You want self-contained code? Well that’s literally the problem a package—installed via Composer—is for.

1 like
LexianDEV's avatar

@martinbean Sorry, I'm considering doing composer packages instead, I just don't want people to install it thinking it's for something relevant to them, say you download a wordpress plugin to composer and your project isn't wordpress, I'd like to prevent that as it might break something perhaps.

1 like
martinbean's avatar
Level 80

@LexianDEV And? If someone tries to install a completely unsuitable package not knowing entirely what it is, and it breaks their project, then that’s on them 🤷‍♂️

2 likes

Please or to participate in this conversation.