From 80321f422629b84f6bb8f64dcc7d26e107f97871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D0=BB=D0=B5=D1=80=D0=B8=D0=B9=20=D0=91=D1=83?= =?UTF-8?q?=D0=BB=D0=B0=D1=88?= Date: Sat, 6 May 2023 16:04:21 +0300 Subject: [PATCH 1/7] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c89616c..dfad13a 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "joshbrw/laravel-module-installer", + "name": "vbulash/laravel-module-installer", "type": "composer-plugin", "license": "MIT", "autoload": { From 9a95c1f2f3cb238da3873259bc39303f13b2ff00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D0=BB=D0=B5=D1=80=D0=B8=D0=B9=20=D0=91=D1=83?= =?UTF-8?q?=D0=BB=D0=B0=D1=88?= Date: Sat, 6 May 2023 16:09:34 +0300 Subject: [PATCH 2/7] Update LaravelModuleInstaller.php --- src/LaravelModuleInstaller.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/LaravelModuleInstaller.php b/src/LaravelModuleInstaller.php index b05bd0a..6232f47 100644 --- a/src/LaravelModuleInstaller.php +++ b/src/LaravelModuleInstaller.php @@ -50,6 +50,11 @@ protected function getBaseInstallationPath() */ protected function getModuleName(PackageInterface $package) { + $extra = $package->getExtra(); + if ($extra && isset($extra['module-name'])) { + return ucfirst($extra['module-name']); + } + $name = $package->getPrettyName(); $split = explode("/", $name); From cc1c8ccc054b6a7ad6341302190501b7b58fb0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D0=BB=D0=B5=D1=80=D0=B8=D0=B9=20=D0=91=D1=83?= =?UTF-8?q?=D0=BB=D0=B0=D1=88?= Date: Sat, 6 May 2023 16:12:05 +0300 Subject: [PATCH 3/7] Update composer.json --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index dfad13a..e633d21 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "vbulash/laravel-module-installer", "type": "composer-plugin", "license": "MIT", + "version": "1.0", "autoload": { "psr-4": { "Joshbrw\\LaravelModuleInstaller\\": "src/" From e043d3b339a27fb8435e193410ac1b96bcd846cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D0=BB=D0=B5=D1=80=D0=B8=D0=B9=20=D0=91=D1=83?= =?UTF-8?q?=D0=BB=D0=B0=D1=88?= Date: Sat, 6 May 2023 17:05:33 +0300 Subject: [PATCH 4/7] Update README.md --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4c5aac7..56fcbc0 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,24 @@ The purpose of this package is to allow for easy installation of standalone Modules into the [Laravel Modules](https://github.com/nWidart/laravel-modules) package. This package will ensure that your module is installed into the `Modules/` directory instead of `vendor/`. -You can specify an alternate directory by including a `module-dir` in the extra data in your composer.json file: +You can specify an alternate directory by including a `module-dir` in the extra data in your app `composer.json` file: "extra": { "module-dir": "Custom" } +Also you can specify exact module name in package `composer.json` before its publication: + + "extra": { + "module-name": "blog" + } + +Here in example target folder is `Modules/Blog` (`ucfirst` for `module-name` applied). ## Installation 1. Ensure you have the `type` set to `laravel-module` in your module's `composer.json` -2. Ensure your package is named in the convention `/-module`, for example `joshbrw/user-module` would install into `Modules/User` +2. (Skip when package's `composer.json` contains `module-name`). Ensure your package is named in the convention `/-module`, for example `joshbrw/user-module` would install into `Modules/User` 3. Require this package: `composer require joshbrw/laravel-module-installer` 4. Require your bespoke module using Composer. You may want to set the constraint to `dev-master` to ensure you always get the latest version. From d18d79a1b83368da176caf5d38717ff8883c05dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D0=BB=D0=B5=D1=80=D0=B8=D0=B9=20=D0=91=D1=83?= =?UTF-8?q?=D0=BB=D0=B0=D1=88?= Date: Sat, 6 May 2023 17:09:56 +0300 Subject: [PATCH 5/7] Update composer.json Return package name back to original --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e633d21..f37e476 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "vbulash/laravel-module-installer", + "name": "joshbrw/laravel-module-installer", "type": "composer-plugin", "license": "MIT", "version": "1.0", From a3307bbc6a22a126959e2e301aae30148e0b0115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D0=BB=D0=B5=D1=80=D0=B8=D0=B9=20=D0=91=D1=83?= =?UTF-8?q?=D0=BB=D0=B0=D1=88?= Date: Sat, 6 May 2023 17:12:27 +0300 Subject: [PATCH 6/7] Revert back to original file --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index f37e476..c89616c 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,6 @@ "name": "joshbrw/laravel-module-installer", "type": "composer-plugin", "license": "MIT", - "version": "1.0", "autoload": { "psr-4": { "Joshbrw\\LaravelModuleInstaller\\": "src/" From 574fd00985b7e872923a27c89aad9a402f3058b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D0=BB=D0=B5=D1=80=D0=B8=D0=B9=20=D0=91=D1=83?= =?UTF-8?q?=D0=BB=D0=B0=D1=88?= Date: Sat, 6 May 2023 17:28:59 +0300 Subject: [PATCH 7/7] Personal version when Josh thinking about my proposal --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c89616c..e633d21 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,8 @@ { - "name": "joshbrw/laravel-module-installer", + "name": "vbulash/laravel-module-installer", "type": "composer-plugin", "license": "MIT", + "version": "1.0", "autoload": { "psr-4": { "Joshbrw\\LaravelModuleInstaller\\": "src/"