Upgrading To v1.8 From v1.7

Exciting New Features ๐ŸŽ‰

Enhancements ๐Ÿš€

Breaking Changes ๐Ÿ› 

Bug Fixes ๐Ÿ›

Upgrade Guide

Estimated Upgrade Time: 1 Minutes

Updating Dependencies

Update dependencies in the go.mod file:

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

Add model association for Orm

Version: v1.8.0

Add methods for Orm, to handle model association:

DBGeneric Database Interface sql.DB
LoadLazy Eager Loading
LoadMissingLazy Eager Loading(not exist)
OmitOmit associations
WithEager Loading

Add methods for Request

Version: v1.8.0

Add methods for ctx.Request(), to enrich the format of Query parameters:

QueryArrayGet the array parameters
QueryMapGet the map parameters


Version: v1.8.0

Add Origin method to ctx.Response(), you can get all information of Response in the HTTP middleware.


Optimize import order

Version: v1.8.0

The import order in the bootstrap/app.go file change to:

package bootstrap

import (


The Fileopen in new window

Optimize database migrate

Version: v1.8.0

Run the command that generate the migrate file: go run . artisan make:migration create_users_table, the corresponding migration file will be generated based on the default database driver currently in use(facades.Config.GetString("database.default")).

mock.Validator Change Name

Version: v1.8.0

If you use mock.Validator to write unit tests, the following modifications are required:

import "github.com/goravel/framework/testing/mock"


// Modify to

import "github.com/goravel/framework/testing/mock"



support.Mysql Change Name

Version: v1.8.0

If you use framework constants such as support.Mysql to judge the database driver, you need to make the following modifications:

import "github.com/goravel/framework/database/support"


// Modify to

import "github.com/goravel/framework/contracts/database/orm"


The new constants such as orm.Mysql are of type orm.Driver and can be converted to a string type using the orm.Mysql.String() method.

database.NewGormInstance is about to be deprecated

Version: v1.8.0

The database.NewGormInstance method will be deprecated in v1.9.0 version, it can be used in current version, if you use the method to get the gorm instance, the following modifications are required:

import "github.com/goravel/framework/database"

gorm, err := database.NewGormInstance(connection)

// Modify to

import "github.com/goravel/framework/database/gorm"

gorm, err := gorm.New(connection)

Fix Orm concurrency safety issue

Version: v1.8.1

When high concurrent access, reading facades.Orm for the first time may return nil.

Fix Mail module can't send mail by 25 and 465 ports

Version: v1.8.2

You can send mail by 25, 465, 587 ports now.

Route supports HTTPS

Version: v1.8.3

facades.Route Add RunTLS method๏ผŒsupport start HTTPS server, For Detail.