Skip to content

Latest commit

 

History

History
executable file
·
27 lines (23 loc) · 685 Bytes

README.md

File metadata and controls

executable file
·
27 lines (23 loc) · 685 Bytes

Service Generator

Create service using command

Installation

  • Clone this repo git clone https://github.com/ahmadarif/adonis-service-generator ServiceGenerator
  • Copy ServiceGenerator folder to YOUR_PROJECT/providers
  • Register in start/app.js
    const Helpers = use('Helpers')
    
    const aceProviders = [
      Helpers.appRoot('providers/ServiceGenerator/providers/ServiceGeneratorProvider')
    ]

Usage

  • Generate service

    adonis make:service auth
    

    This command will generate app/Services/AuthService.js

  • Usage in controller or other file

    const AuthService = use('App/Service/AuthService')
    await AuthService.someFunction()