From 4031efae3d6b4894bb47a9184121ffcc51d9d4b3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 19 Apr 2018 21:16:48 +0300 Subject: [PATCH] Update docs --- app/Console/Commands/MakeModule.php | 8 ++++---- docs/custom_modules.rst | 27 ++++++++++++++------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/Console/Commands/MakeModule.php b/app/Console/Commands/MakeModule.php index 88291b78c50f..3b95d0d45e28 100644 --- a/app/Console/Commands/MakeModule.php +++ b/app/Console/Commands/MakeModule.php @@ -42,7 +42,7 @@ class MakeModule extends Command $fields = $this->argument('fields'); $migrate = $this->option('migrate'); $lower = strtolower($name); - + // convert 'name:string,description:text' to 'name,description' $fillable = explode(',', $fields); $fillable = array_map(function ($item) { @@ -69,10 +69,10 @@ class MakeModule extends Command Artisan::call('ninja:make-class', ['name' => $name, 'module' => $name, 'class' => 'transformer', '--fields' => $fields]); Artisan::call('ninja:make-class', ['name' => $name, 'module' => $name, 'class' => 'lang', '--filename' => 'texts']); - if ($migrate == 'false') { - $this->info("Use the following command to run the migrations:\nphp artisan module:migrate $name"); - } else { + if ($migrate == 'true') { Artisan::call('module:migrate', ['module' => $name]); + } else { + $this->info("Use the following command to run the migrations:\nphp artisan module:migrate $name"); } Artisan::call('module:dump'); diff --git a/docs/custom_modules.rst b/docs/custom_modules.rst index 58b3d06a8fc0..6199f4909d36 100644 --- a/docs/custom_modules.rst +++ b/docs/custom_modules.rst @@ -20,11 +20,7 @@ For example: php artisan module:install invoiceninja/sprockets --type=github -You can check the current module status with: - -.. code-block:: php - - php artisan module:list +.. TIP:: One a module is installed it can enabled/disabled on Settings > Account Management Create Module @@ -36,17 +32,13 @@ Run the following command to create a CRUD module: php artisan ninja:make-module +For example: + .. code-block:: php php artisan ninja:make-module Inventory 'name:string,description:text' -To edit the migration before it's run add ``--migrate=false`` - -.. code-block:: php - - php artisan ninja:make-module --migrate=false - -After making adjustments to the migration file you can run: +To run the database migration use: .. code-block:: php @@ -58,7 +50,7 @@ After making adjustments to the migration file you can run: Share Module """""""""""" -To share your module create a new project on GitHub and then commit the code: +To share your module create a new project on GitHub and then run the following code: .. code-block:: php @@ -72,3 +64,12 @@ To share your module create a new project on GitHub and then commit the code: .. Tip:: Add ``"type": "invoiceninja-module"`` to the composer.json file to help people find your module. Finally, submit the project to https://packagist.org. + +Developer Notes +""""""""""""""" + +There are two types of modules: you can either create a standard module which displays a list of a new entity type or you can create a blank module which adds functionality. For example, a custom integration with a third-party app. + +If you're looking for a module to work on you can see suggested issues `listed here `_. + +.. NOTE:: Our module implemention is currenty being actively worked on, you can join the discussion on our Slack group: http://slack.invoiceninja.com/