Upgrading To v1.9 From v1.8

Enhancements 🚀

Breaking Changes 🛠

Bug Fixes 🐛

Dependency Updates ⬆️

  • build(deps): bump github.com/gin-gonic/gin from v1.7.3 to v1.8.2

Upgrade Guide

Estimated Upgrade Time: 10 Minutes

Updating Dependencies

Update dependencies in the go.mod file:

go get -u github.com/goravel/framework@v1.9.0

Add database read-write separation

Version: v1.9.0

Database supports read-write separation,For Detail.

Add database pool configuration

Version: v1.9.0

Add pool configuration for the database configuration file: config/database.go, For Detailopen in new window.

Custom .env path

Version: v1.9.0

// Develop
go run . --env=../.env

// Compiled
./main --env=../.env

Cache add memory driver

Version: v1.9.0

config/cache.go add memory configuration:

"stores": map[string]any{
  // New
  "memory": map[string]any{
    "driver": "memory",

For Detailopen in new window

Orm add Paginate method

Version: v1.9.0

facades.Orm add Paginate method, For detail.

Add make command

Version: v1.9.0

// Create controller
go run . artisan make:controller UserController

// Create middleware
go run . artisan make:middleware Cors

// Create model
go run . artisan make:model User

Add new methods for Response

Version: v1.9.0

DataCustom return

Add return for Request PrepareForValidation method

Version: v1.9.0

If you are using PrepareForValidation method in Validation, please add a return value: PrepareForValidation(data validation.Data) error.

File gets the wrong file type

Version: v1.9.0

Fix the problem that .docx, .xlsx, etc. are incorrectly identified as .zip.

Fix template error on make:event and make:listener command

Version: v1.9.0

import "github.com/goravel/framework/contracts/events" 改为 import "github.com/goravel/framework/contracts/event"

Fix some types cannot obtain suffixes when save file

Version: v1.9.1

Some types cannot obtain suffixes through the code shown below:

file, err := ctx.Request().File()