Groovel blog : The platform for web artisans


Develop your own package

by groovel

Posted on 2016-11-19 22:37:49

One mistake that makes software is to complicate the way to develop new modules.
In groovel, I make choice to use a framework : Laravel that enables the way to develop new components easily
How do you process it in Groovel?

For example i create a new package to handle payment paypal,First we create a new folder called (for example packages) like this :


We Create our service provider that will be handled and registrated in Laravel : more expertise in Laravel info : , if you ve got some problems ask me ;)



In config directory, in the file app.php declare your provider

In composer.json file declare your path to your package :
"Groovel\\Paypal\\": "packages/groovel/paypal/src/"




Finally launch the command composer dump-autoload , this command will do all for you, manage dependencies, and registrate classes in your application

In directory vendor/composer look at the file autoload_psr4.php you will see your binding, all your classes will be loaded in your path.



That's all!

When your package is ready to publish i will explain in next blog post how to share it for everybody ! in packagist :-)

Leave a Comment: