Giter VIP home page Giter VIP logo

laravel-package-generator's Introduction

Laravel package generator

Build Status styleci SensioLabsInsight Scrutinizer Code Quality

Packagist Packagist Packagist

Simple package to quickly generate basic structure for other laravel packages.

Install

Install via composer

composer require --dev melihovv/laravel-package-generator

Add service provider to config/app.php in providers section (it is optional step if you use laravel>=5.5 with package auto discovery feature)

Melihovv\LaravelPackageGenerator\ServiceProvider::class,

Publish package config if you want customize default values

php artisan vendor:publish --provider="Melihovv\LaravelPackageGenerator\ServiceProvider" --tag="config"

Available commands

php artisan package:new -i {vendor} {package}

Create new package.

Example: php artisan package:new Melihovv SomeAwesomePackage

This command will:

  • Create packages/melihovv/some-awesome-package folder
  • Register package in app composer.json
  • Copy package skeleton from skeleton folder to created folder (you can provide your custom skeleton path in config)
  • Run git init packages/melihovv/some-awesome-package
  • Run composer update melihovv/some-awesome-package
  • Run composer dump-autoload

With interactive -i flag you will be prompted for every needed value from you.

php artisan package:remove {vendor} {package}

Remove the existing package.

Example: php artisan package:remove Melihovv SomeAwesomePackage

This command will:

  • Run composer remove melihovv/some-awesome-package
  • Remove packages/melihovv/some-awesome-package folder
  • Unregister package in app composer.json
  • Run composer dump-autoload

Interactive mode also possible.

php artisan package:clone

Clone the existing package.

Example: php artisan package:clone https://github.com/melihovv/laravel-env-validator Melihovv LaravelEnvValidator --src=src/LaravelEnvValidator

This command will:

  • Clone specified repo in packages/melihovv/laravel-env-validator folder
  • Register package in app composer.json
  • Run composer update melihovv/laravel-env-validator
  • Run composer dump-autoload

Interactive mode also possible. If you need you can specify which branch to clone with -b flag.

Custom skeleton

This package will copy all folders and files from specified skeleton path to package folder. You can use templates in your skeleton. All files with tpl extension will be provided with some variables available to use in them. tpl extension will be stripped.

Available variables to use in templates:

  • vendor (e.g. Melihovv)
  • package (e.g. SomeAwesomePackage)
  • vendorFolderName (e.g. melihovv)
  • packageFolderName (e.g. some-awesome-package)
  • packageHumanName (e.g. Some awesome package)
  • composerName (e.g. melihovv/some-awesome-package)
  • composerDesc (e.g. A some awesome package)
  • composerKeywords (e.g. some,awesome,package)
  • licence (e.g. MIT)
  • phpVersion (e.g. >=7.0)
  • aliasName (e.g. some-awesome-package)
  • configFileName (e.g. some-awesome-package)
  • year (e.g. 2017)
  • name (e.g. Alexander Melihov)
  • email (e.g. [email protected])
  • githubPackageUrl (e.g. https://github.com/melihov/some-awesome-package)

Things you need to to manually:

  • Service provider and alias registration (if you use laravel <5.5)
  • In README.md:
    • StyleCI repository identifier
    • Sensio Insight repository identifier
    • Package description
    • Usage section

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

laravel-package-generator's People

Contributors

1242035 avatar melihovv avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.