├── .styleci.yml
├── .gitignore
├── config
└── packagerhermes.php
├── src
├── PackagerHermes.php
├── Facades
│ └── PackagerHermes.php
├── PackagerHermesServiceProvider.php
└── Commands
│ └── MakeController.php
├── changelog.md
├── phpunit.xml
├── .travis.yml
├── license.md
├── contributing.md
├── composer.json
└── readme.md
/.styleci.yml:
--------------------------------------------------------------------------------
1 | preset: laravel
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | vendor
2 | composer.lock
3 |
--------------------------------------------------------------------------------
/config/packagerhermes.php:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 | ./tests/
15 |
16 |
17 |
18 |
19 | src/
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | php:
4 | - 7.1
5 | - 7.2
6 | - nightly
7 |
8 | cache:
9 | directories:
10 | - $HOME/.composer/cache
11 |
12 | env:
13 | - TESTBENCH_VERSION=3.6.* PHPUNIT_VERSION=~7 STABILITY=stable
14 | - TESTBENCH_VERSION=dev-master PHPUNIT_VERSION=~7 STABILITY=dev
15 |
16 | matrix:
17 | include:
18 | - php: 7.0
19 | env: TESTBENCH_VERSION=3.5.* PHPUNIT_VERSION=~6 STABILITY=stable
20 | allow_failures:
21 | - env: TESTBENCH_VERSION=dev-master PHPUNIT_VERSION=~7 STABILITY=dev
22 | - php: nightly
23 | fast_finish: true
24 |
25 | before_script:
26 | - travis_retry composer self-update
27 | - composer config minimum-stability ${STABILITY}
28 | - travis_retry composer require "orchestra/testbench:${TESTBENCH_VERSION}" "phpunit/phpunit:${PHPUNIT_VERSION}" --no-update
29 | - travis_retry composer update --no-interaction --prefer-source
30 |
31 | script:
32 | - phpunit --coverage-text --coverage-clover=coverage.clover
33 |
--------------------------------------------------------------------------------
/license.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 DelveFore, LLC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/contributing.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Contributions are welcome and will be fully credited.
4 |
5 | Contributions are accepted via Pull Requests on [Github](https://github.com/delvefore/packagerhermes).
6 |
7 | # Things you could do
8 | If you want to contribute but do not know where to start, this list provides some starting points.
9 | - Add license text
10 | - Remove rewriteRules.php
11 | - Set up TravisCI, StyleCI, ScrutinizerCI
12 | - Write a comprehensive ReadMe
13 |
14 | ## Pull Requests
15 |
16 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests.
17 |
18 | - **Document any change in behaviour** - Make sure the `readme.md` and any other relevant documentation are kept up-to-date.
19 |
20 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
21 |
22 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
23 |
24 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
25 |
26 |
27 | **Happy coding**!
28 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "delvefore/laravel-packager-hermes",
3 | "description": "Artisan make Commands when using https://github.com/Jeroen-G/laravel-packager thereby accelerating your development of Laravel Packages. ",
4 | "license": "MIT",
5 | "authors": [
6 | {
7 | "name": "johntimothybailey",
8 | "email": "social@delvefore.com",
9 | "homepage": "https://github.com/delvefore"
10 | }
11 | ],
12 | "homepage": "https://github.com/delvefore/laravel-packager-hermes",
13 | "keywords": ["Laravel", "PackagerHermes"],
14 | "require": {
15 | "illuminate/support": "~5"
16 | },
17 | "require-dev": {
18 | "phpunit/phpunit": "~7.0",
19 | "mockery/mockery": "^1.1",
20 | "orchestra/testbench": "~3.0",
21 | "sempro/phpunit-pretty-print": "^1.0",
22 | "sensiolabs/security-checker": "^5.0"
23 | },
24 | "autoload": {
25 | "psr-4": {
26 | "DelveFore\\PackagerHermes\\": "src/"
27 | }
28 | },
29 | "autoload-dev": {
30 | "psr-4": {
31 | "DelveFore\\PackagerHermes\\Tests\\": "tests"
32 | }
33 | },
34 | "extra": {
35 | "laravel": {
36 | "providers": [
37 | "DelveFore\\PackagerHermes\\PackagerHermesServiceProvider"
38 | ],
39 | "aliases": {
40 | "PackagerHermes": "DelveFore\\PackagerHermes\\Facades\\PackagerHermes"
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/PackagerHermesServiceProvider.php:
--------------------------------------------------------------------------------
1 | app->runningInConsole()) {
25 | $this->bootForConsole();
26 | }
27 | }
28 |
29 | /**
30 | * Register any package services.
31 | *
32 | * @return void
33 | */
34 | public function register()
35 | {
36 | $this->mergeConfigFrom(__DIR__.'/../config/packagerhermes.php', 'packagerhermes');
37 |
38 | // Register the service the package provides.
39 | $this->app->singleton('packagerhermes', function ($app) {
40 | return new PackagerHermes;
41 | });
42 |
43 | // Register commands for Artisan interface.
44 | $this->commands($this->commands);
45 | }
46 |
47 | /**
48 | * Get the services provided by the provider.
49 | *
50 | * @return array
51 | */
52 | public function provides()
53 | {
54 | return ['packagerhermes'];
55 | }
56 |
57 | /**
58 | * Console-specific booting.
59 | *
60 | * @return void
61 | */
62 | protected function bootForConsole()
63 | {
64 | // Publishing the configuration file.
65 | $this->publishes([
66 | __DIR__.'/../config/packagerhermes.php' => config_path('packagerhermes.php'),
67 | ], 'packagerhermes.config');
68 |
69 | // Registering package commands.
70 | $this->commands($this->commands);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/Commands/MakeController.php:
--------------------------------------------------------------------------------
1 | rootNamespace(), '', $name);
28 | $name = str_replace('\\', '/', $name);
29 | $basePath = str_replace('\\', '/', $this->laravel->basePath());
30 | $namespace = str_replace('\\', '/', $this->rootNamespace());
31 | $path = $basePath.'/'.'packages/'.$namespace.'/src/App'.$name.'.php';
32 | return $path;
33 | }
34 |
35 | /**
36 | * Get the desired class name from the input.
37 | *
38 | * @return string
39 | */
40 | protected function getNamespaceInput()
41 | {
42 | return str_replace('/', '\\', trim($this->argument('namespace')));
43 | }
44 |
45 |
46 | /**
47 | * Get the root namespace for the class.
48 | *
49 | * @return string
50 | */
51 | protected function rootNamespace()
52 | {
53 | return $this->getNamespaceInput();
54 | }
55 |
56 | /**
57 | * Get the console command arguments.
58 | *
59 | * @return array
60 | */
61 | protected function getArguments()
62 | {
63 | return [
64 | ['namespace', InputArgument::REQUIRED, 'The namespace of the package for the controller'],
65 | ['name', InputArgument::REQUIRED, 'The name of the controller'],
66 | ];
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # PackagerHermes
2 |
3 | [![Latest Version on Packagist][ico-version]][link-packagist]
4 | [![Total Downloads][ico-downloads]][link-downloads]
5 | [![Build Status][ico-travis]][link-travis]
6 | [![StyleCI][ico-styleci]][link-styleci]
7 |
8 | Laravel Packager Hermes enables usage of Artisan make commands for accelerating package development with [Jeroen-G's Laravel Packager](https://github.com/Jeroen-G/laravel-packager).
9 |
10 | In other words, this is a wrapper around Laravel 5 Artisan commands that targets `packages/` created by [Jeroen-G's Laravel Packager](https://github.com/Jeroen-G/laravel-packager). With both of these tools, you can get to building and publishing your packages quickly!
11 |
12 | ## Installation
13 |
14 | Via Composer
15 |
16 | ``` bash
17 | $ composer require delvefore/packager-hermes
18 | ```
19 |
20 | Please note that this is specifically designed to work with the latest version of Laravel 5.
21 | However, you'd like to use it with Laravel 5.4 and below use service provider in `config/app.php`:
22 |
23 | ```php
24 | JeroenG\Packager\PackagerServiceProvider::class,
25 | ```
26 |
27 |
28 | ## Available Commands
29 | ### Make Controller
30 |
31 | ```bash
32 | $ php artisan make:packager:controller MyVendor/MyPackage MyController
33 | ```
34 | All options are the same as with [Laravel's Artisan Make Controller](https://github.com/laravel/framework/blob/5.7/src/Illuminate/Routing/Console/ControllerMakeCommand.php#L176)
35 |
36 | ## Change log
37 |
38 | Please see the [changelog](changelog.md) for more information on what has changed recently.
39 |
40 | ## Testing
41 |
42 | ``` bash
43 | $ composer test
44 | ```
45 |
46 | ## Contributing
47 |
48 | Please see [contributing.md](contributing.md) for details and a todolist.
49 |
50 | ## Security
51 |
52 | If you discover any security related issues, please email social@delvefore.com instead of using the issue tracker.
53 |
54 | ## Credits
55 |
56 | - [johntimothybailey][link-author]
57 | - [All Contributors][link-contributors]
58 |
59 | ## License
60 |
61 | MIT. Please see the [license file](license.md) for more information.
62 |
63 | [ico-version]: https://img.shields.io/packagist/v/delvefore/laravel-packager-hermes.svg?style=flat-square
64 | [ico-downloads]: https://img.shields.io/packagist/dt/delvefore/laravel-packager-hermes.svg?style=flat-square
65 | [ico-travis]: https://img.shields.io/travis/DelveFore/laravel-packager-hermes/master.svg?style=flat-square
66 | [ico-styleci]: https://styleci.io/repos/12345678/shield
67 |
68 | [link-packagist]: https://packagist.org/packages/delvefore/laravel-packager-hermes
69 | [link-downloads]: https://packagist.org/packages/delvefore/laravel-packager-hermes
70 | [link-travis]: https://travis-ci.org/DelveFore/laravel-packager-hermes
71 | [link-styleci]: https://styleci.io/repos/12345678
72 | [link-author]: https://github.com/delvefore
73 | [link-contributors]: ../../contributors]
74 |
--------------------------------------------------------------------------------