Module Methods


Get an entity from a specific module.

Copied!
$module = Module::find('blog');

Get module name.

Copied!
$module->getName();

Get module name in lowercase.

Copied!
$module->getLowerName();

Get module name in studlycase.

Copied!
$module->getStudlyName();

Get name in snake case.

Copied!
$module->getSnakeName();

Get module description.

Copied!
$module->getDescription();

Get module priority.

Copied!
$module->getPriority();

Get a specific data from module.json file by given the key.

Copied!
$module->get('description');

Get a specific data from composer.json file by given the key.

Copied!
$module->getComposerAttr('name');

Get module path.

Copied!
$module->getPath();

Get extra path.

Copied!
$module->getExtraPath('Assets');

Disable the specified module.

Copied!
$module->disable();

Enable the specified module.

Copied!
$module->enable();

Check if enabled:

Copied!
$module->isEnabled();

Check if disabled:

Copied!
$module->isDisabled();

Check if the status it true or false by passing true or false:

Copied!
$module->isStatus(false); //returns true if active false if is not active

You can also do a call in one go:

Copied!
Module::find('Posts')->isEnabled();

Only run the one liner if you've first checked the module exists otherwise you will get an error.

Delete the specified module.

Copied!
$module->delete();

Set active state for current module.

Copied!
$module->setActive(false);

Get an array of module requirements. Note: these should be aliases of the module.

Copied!
$module->getRequires();


Laravel Package built by Nicolas Widart.

Maintained by David Carr follow on X @dcblogdev