hello

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 5 Imported by: 0

README

An Example For A Goravel Extend Package

Directory Structure

This is a directory standard, but you can change it if you like.

Directory Action
commands Store the command files
config Store the config files
contracts Store the contract files
facades Store the facade files
root Store the service provider and package source code

Install

  1. Add package
go get -u github.com/goravel/example-package
  1. Register service provider
// config/app.go
import examplepackage "github.com/goravel/example-package"

"providers": []foundation.ServiceProvider{
    ...
    &examplepackage.ServiceProvider{},
}
  1. Publish Configuration
go run . artisan vendor:publish --package=github.com/goravel/example-package
  1. Testing
// main.go
import examplefacades "github.com/goravel/example-package/facades"

fmt.Println(examplefacades.Hello().World())

The console will print Welcome To Goravel Package.

Documentation

Index

Constants

View Source
const Binding = "hello"

Variables

Functions

This section is empty.

Types

type Hello added in v1.0.0

type Hello struct {
	// contains filtered or unexported fields
}

func NewHello added in v1.0.0

func NewHello(config config.Config) *Hello

func (*Hello) World added in v1.0.0

func (s *Hello) World() string

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (receiver *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register

func (receiver *ServiceProvider) Register(app foundation.Application)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL