Looking to hire Laravel developers? Try LaraJobs

laravel-package-maker maintained by backtheweb

Description
A Laravel package to create new packages with a simple command
Last update
2023/05/30 23:44 (dev-main)
License
Downloads
21

Comments
comments powered by Disqus

Laravel PackageMaker

Installation

Install the package via composer:

$ composer require backtheweb/laravel-package-maker --dev

Publish the config file and edit it to your needs

$ php artisan vendor:publish --provider="Backtheweb\PackageMaker\PackageMakerServiceProvider" --tag="config"

Create a new folder called modules (or wherever you want, don't forget update the config file) in the root of your Laravel project and add the following to your composer.json file:

"repositories": [
  {
    "type": "path",
    "url": "modules/*/**",
    "options": {
    "symlink": false
  }
]
  $ php artisan make:package vendor/package

The command will create the following structure and files:

  • packageName
    • config
      • packageName.php
    • src
      • PackageNameServiceProvider.php
    • tests
      • Feature
      • Unit
      • TestCase.php
    • .gitignore
    • CHANGELOG.md
    • composer.json
    • LICENSE
    • phpunit.xml
    • README.md

USer --force option to overwrite existing files

  $ php artisan make:package yourPackageName --force

How Laravel package development

https://laravelpackage.com/#reasons-to-develop-a-package

Credits