Login    Register

Doptor Module Creation by Custome Code.

Doptor Development related discuss here.
  • Author

Doptor Module Creation by Custome Code.

Postby ranabd » Fri Jun 19, 2015 11:25 am

Few Steps for Inserting Extra code in Doptor Module.

Create a form using Drag & Drop, crate a Module, it will download automatic in your PC/Laptop.
Than unzip for downloaded module. follow the below instruction :


The module to be installed should be in zip format and should have the following structure:

- ModuleName
-- Controllers
-- Migrations
-- Models
-- Views
-- routes.php​
- module.json

The controllers, migrations, models and views should go inside their respective folders. I have attached a sample module to illustrate it. The module was created using module builder. The only change that I have done is added a migration file to the Migrations folder. I haven't written any other code in that module because the custom code to be written can be completely in Laravel and there's no Doptor specific code needed. You can write Laravel code inside the module. One thing that you need to take care is that the controllers and models should be namespaced properly as in the sample module. If you need to create new database tables, you can write them as migration files inside the migration folder. The migration files inside the Migrations folder are migrated during the module install i.e. the up function is called during module install and down function is called during module deletion (same as in Laravel). The code inside all the folders mentioned above is completely Laravel, there is no any Doptor specific code that needs to be written for custom modules, any Laravel code should work fine. If you want to add new routes, you can add it inside the routes.php file. Basically everything is just Laravel. You can also look at the sample module to see how things such as passing parameters to view are done and for other things also.

After custom module has been written it needs to be packaged as a zip file with the file structure as mentioned above and can be installed by Module Installer.

Posts: 4
Joined: Tue Apr 15, 2014 2:07 pm

Return to Doptor Development Forums

Who is online

Users browsing this forum: No registered users and 1 guest