Skip to content

Service Generator ‚Äč

The Service Generator Command, will create a new Service Class for the provided Module, with a basic boilerplate code. If you want to create a new Profile Service, for the Customer Module, you can run the following command:

php artisan modular:make-service Customer Profile

A new Profile.php Service Class will be created at modules/Customer/Services/Profile.php.

The generated Service Class will have the following content:


namespace Modules\Customer\Services;

class Profile
    public function __invoke()