backtheweb/laravel-package-maker

A Laravel package to create new packages with a simple command

0.1.0 2023-05-11 10:48 UTC

This package is auto-updated.

Last update: 2024-04-30 00:36:25 UTC


README

package-svgrepo-com-4.png?width=96

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