github.com/goravel/framework@v1.13.9/queue/service_provider.go (about)

     1  package queue
     2  
     3  import (
     4  	"github.com/goravel/framework/contracts/console"
     5  	"github.com/goravel/framework/contracts/foundation"
     6  	queueConsole "github.com/goravel/framework/queue/console"
     7  )
     8  
     9  const Binding = "goravel.queue"
    10  
    11  type ServiceProvider struct {
    12  }
    13  
    14  func (receiver *ServiceProvider) Register(app foundation.Application) {
    15  	app.Singleton(Binding, func(app foundation.Application) (any, error) {
    16  		return NewApplication(app.MakeConfig(), app.MakeLog()), nil
    17  	})
    18  }
    19  
    20  func (receiver *ServiceProvider) Boot(app foundation.Application) {
    21  	receiver.registerCommands(app)
    22  }
    23  
    24  func (receiver *ServiceProvider) registerCommands(app foundation.Application) {
    25  	app.MakeArtisan().Register([]console.Command{
    26  		&queueConsole.JobMakeCommand{},
    27  	})
    28  }