Update docs

This commit is contained in:
Hillel Coren 2018-04-19 21:16:48 +03:00
parent 7dc2af88eb
commit 4031efae3d
2 changed files with 18 additions and 17 deletions

View File

@ -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');

View File

@ -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 <module> <fields>
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 <module> <fields> --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 <https://github.com/invoiceninja/invoiceninja/issues?q=is%3Aissue+is%3Aopen+label%3A%22custom+module%22>`_.
.. NOTE:: Our module implemention is currenty being actively worked on, you can join the discussion on our Slack group: http://slack.invoiceninja.com/