1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/docs/custom_modules.rst

73 lines
2.2 KiB
ReStructuredText
Raw Normal View History

2016-12-07 22:16:11 +01:00
Custom Modules
==============
Invoice Ninja support customs modules using https://github.com/nWidart/laravel-modules
2016-12-12 22:42:54 +01:00
You can watch this `short video <https://www.youtube.com/watch?v=8jJ-PYuq85k>`_ for a quick overview of the feature.
2016-12-07 22:16:11 +01:00
Install Module
""""""""""""""
To install a module run:
2016-12-07 22:17:28 +01:00
.. code-block:: php
2016-12-07 22:16:11 +01:00
php artisan module:install <vendor/module> --type=github
For example:
2016-12-07 22:17:28 +01:00
.. code-block:: php
2016-12-07 22:16:11 +01:00
php artisan module:install invoiceninja/sprockets --type=github
2018-04-19 20:16:48 +02:00
.. TIP:: One a module is installed it can enabled/disabled on Settings > Account Management
2016-12-07 22:16:11 +01:00
Create Module
"""""""""""""
2016-12-09 13:18:22 +01:00
Run the following command to create a CRUD module:
2016-12-07 22:16:11 +01:00
2016-12-07 22:17:28 +01:00
.. code-block:: php
2016-12-07 22:16:11 +01:00
2016-12-09 13:23:24 +01:00
php artisan ninja:make-module <module> <fields>
2018-04-19 20:16:48 +02:00
For example:
2016-12-09 13:10:46 +01:00
.. code-block:: php
2018-04-19 20:16:48 +02:00
php artisan ninja:make-module Inventory 'name:string,description:text'
2016-12-09 13:10:46 +01:00
2018-04-19 20:16:48 +02:00
To run the database migration use:
2016-12-09 13:10:46 +01:00
.. code-block:: php
2016-12-13 11:51:13 +01:00
php artisan module:migrate <module>
2016-12-07 22:16:11 +01:00
.. Tip:: You can specify the module icon by setting a value from http://fontawesome.io/icons/ for "icon" in module.json.
2016-12-07 22:16:11 +01:00
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 do not want an entry in the application navigation sidebar, add "no-sidebar": 1 to the custom module's module.json.
2018-04-19 20:17:50 +02:00
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/
2016-12-07 22:16:11 +01:00
Share Module
""""""""""""
2018-04-19 20:16:48 +02:00
To share your module create a new project on GitHub and then run the following code:
2016-12-07 22:16:11 +01:00
2016-12-07 22:17:28 +01:00
.. code-block:: php
2016-12-07 22:16:11 +01:00
cd Modules/<module>
git init
git add .
git commit -m "Initial commit"
git remote add origin git@github.com:<vendor/module>.git
git push -f origin master
.. Tip:: Add ``"type": "invoiceninja-module"`` to the composer.json file to help people find your module.
2016-12-07 22:17:28 +01:00
Finally, submit the project to https://packagist.org.