Open In App

AsgardCMS – Introduction and Generation of Modules

Last Updated : 26 Apr, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

AsgardCMS offers us the facility to add new modules apart from the existing modules in the application. We can add a new module as per our need and demand for the project. Sometimes our project involves various modules to be added. For example, if you are working on a project for insurance then we need to have modules such as customer, insurance, facilities, etc in which each module covers some specific areas of interest.

The module scaffolder is a command that helps to generate needed modules in a very short period of time giving the developer ease to do things.

In order to generate a new module you need to put the following command in CMD after going to the project folder:

php artisan asgard:module:scaffold

Once you enter this command there are a few questions asked by the system related to the module demanded. The questions asked are:

  1. What is the module name ?

    Mention the module in the format as vendor/module name. No dashes should be used while naming the module.

  2. Do you wish to use Doctrine or Eloquent ?

    The doctrine uses the old PHP structure only whereas Eloquent has the concepts of ORM that are object-relation-mapping. This tells what kind of entities the developer wishes to generate. You can choose among the two depending on your project requirement. My project required the logic of ORM so I choose the eloquent for the same.

  3. Enter your desired entities

    You can enter all the required entities. They can be N in number, and you can mention all. If you left it blank the mentioned entities will be generated and the next question will come up on the screen.

  4. Enter your desired value objects

    As per the development demand, one can enter all the objects required. In case no value object is needed one can skip this by leaving it blank. Once these questions are answered the module is generated. Refer to the screenshot below to understand how module creation works.

Creation of new module gfgmodule

By default, the new module generated does not have the permissions, so we have to give it the permissions by going to the user’s section on the page.

In order to provide permissions to the new module, you have to log in to your asgardCMS project. You can refer to this article for understanding how to log in to the project. AsgardCMS – Viewing the created project and the framework

The steps for providing permissions are:

  1. Once you have logged in click on the user section on the page.

    The development web page

  2. Select the Roles dropdown

  3. Select the Admin hyperlink

  4. Select the permissions from the header menu 

    The admin page

  5. Select all the permissions for the new module.

    The permissions

    Permissions for the new module added.

Finally, the new module is created.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads