GithubHelp home page GithubHelp logo

phpanos / laravel-package-maker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from naoray/laravel-package-maker

0.0 1.0 0.0 257 KB

Get a :package: skeleton and all other `make` commands from laravel base for package development.

License: MIT License

PHP 100.00%

laravel-package-maker's Introduction

laravel-package-maker

Software License Total Downloads

I hate creating new controllers, middlewares, ... by copy & paste. Wouldn't it be cool to have all the make commands you use in your daily Laravel app development workflow also for developing new packages? This package was created solely for the purpose to make package development as fast and easy as possible. Creating a new package only takes one command (make:package) and you will end up with the following file structure:

.
└── package
    ├── .codecov.yml
    ├── composer.json
    ├── CONTRIBUTING.md
    ├── .gitignore
    ├── LICENSE.md
    ├── phpunit.xml
    ├── readme.md
    ├── src
    │   └── PackageServiceProvider.php
    ├── .styleci.yml
    ├── tests
    │   └── TestCase.php
    └── .travis.yml

Install

composer require naoray/laravel-package-maker --dev

Usage

php artisan make:package

make:package

php artisan make:nova

Inspired by Spatie's nova-skeleton-tool this command clones the repository, replaces all strings with your own and adds it to your own project.

make:nova

php artisan package:add

If you have already created a package or you want to add a modified version of a package which is currently only available locally, you can use the following command to add you package to your project. It does simply add your package to your project`s composer repositories and requires a local version of it.

This command is run by make:package automatically, so you have no need to execute it after creating a package!

php artisan package:save
				{namespace : Root namespace of the package (Vendor\Package_name)}
				{path : Relative path to the package's directory}

Every package:* command needs to know the package's namespace and the relative path to the location your package is stored. Because of that every package:* command comes with those two options by default. To avoid entering those two options every time a package:* command executed this command saves the credentials of your package in the cache.

php artisan package:delete

This one wipes all stored credentials from your cache.

php artisan package:clone
                {src : Source path of the package to clone}
                {target : Path where it should be cloned in}

The clone command clones a given repository or directory into the given target.

php artisan package:replace 
                {path : The path to a file or directory}
                {--O|old=* : Old strings which will be replaced}
                {--N|new=* : New strings which will be used as replacement}'

The replace command takes a path of a file or a directory and an indefinite number of 'old' options which will be replaced by the 'new' options.

All of these commands do have all arguments & options to which you are used to in a normal laravel app! To execute any of these commands simply add the prefix package:.

  • channel
  • console
  • event
  • exception
  • job
  • listener
  • mail
  • model
  • notification
  • observer
  • policy
  • provider
  • request
  • resource
  • rule
  • test
  • factory
  • migration
  • seeder
  • controller
  • middleware

All of the following routes only accept a name argument.

  • contract
  • interface (same as contract)
  • trait
  • package:basetest {provider : The package's provider name} - creates TestCase in tests folder
  • package:codecov - creates a .codecov.yml file
  • package:composer {--author : The author of the package.} {--email : The author's email.} - creates composer.json
  • package:contribution - creates CONTRIBUTING.md
  • package:gitignore - creates .gitignore file
  • package:license {--copyright : The company or vendor name to place it int the license file} - creates LICENSE.md file
  • package:phpunit - creates phpunit.xml
  • package:readme {--author : The author of the package.} {--email : The author's email.} - creates readme.md
  • package:styleci - creates .styleci.yml
  • package:travis - creates .travis.yml

Use a few make commands package:*

All arguments & options you know from the standard make commands are available. Create a model with all option. package:model --all

Testing

Run the tests with:

vendor/bin/phpunit

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

Security

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

License

The MIT License (MIT). Please see License File for more information.

laravel-package-maker's People

Contributors

byjujohn avatar immeyti avatar naoray avatar rennokki avatar

Watchers

 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.