m615's avatar
Level 2

How do I package an artisan command in order to share it with the community?

I created my first artisan command that allows me to set all of my environment variables all at once if you are using Heroku to host your laravel app.

For me this was really handy because I can put all my different Heroku environment vars in a json file and then call one command and set all or I can choose a single app on heroku and it will run through and update them all at once.

Anyway, I wasn't sure if creating a laravel package was the right way to distribute this or if there is some other preferred method.

0 likes
1 reply
MarianoMoreyra's avatar

Hi @m615

You may want to take a look at this package with tools to make packages:

https://github.com/spatie/laravel-package-tools

It's from Spatie, so you can be sure it's high quality!

Also, they have a skeleton for Laravel packages that might be useful too:

https://github.com/spatie/package-skeleton-laravel

Finally, if you have the chance to spend a few bucks, they have an excellent video course on the topic:

https://spatie.be/products/laravel-package-training

Hope this helps and looking forward to your brand new package!

1 like

Please or to participate in this conversation.