GoravelGoravel
Home
Video
  • English
  • įŽ€äŊ“中文
GitHub
Home
Video
  • English
  • įŽ€äŊ“中文
GitHub
  • Prologue

    • Upgrade Guide

      • Upgrading To v1.15 From v1.14
      • Upgrading To v1.14 From v1.13
      • History Upgrade
    • Contribution Guide
    • Excellent Extend Packages
  • Getting Started

    • Installation
    • Configuration
    • Directory Structure
    • Compile
  • Architecture Concepts

    • Request Lifecycle
    • Service Container
    • Service Providers
    • Facades
  • The Basics

    • Routing
    • HTTP Middleware
    • Controllers
    • Requests
    • Responses
    • Views
    • Grpc
    • Session
    • Validation
    • Logging
  • Digging Deeper

    • Artisan Console
    • Cache
    • Events
    • File Storage
    • Mail
    • Queues
    • Task Scheduling
    • Localization
    • Package Development
    • Color
    • Strings
    • Helpers
  • Security

    • Authentication
    • Authorization
    • Encryption
    • Hashing
  • ORM

    • Getting Started
    • Relationships
    • Migrations
    • Seeding
    • Factories
  • Testing

    • Getting Started
    • HTTP Tests
    • Mock

Upgrading To v1.11 From v1.10

  • v1.11.3
    • Bug Fixes 🐛
  • v1.11.2
    • Bug Fixes 🐛
  • v1.11.1
    • Exciting New Features 🎉
    • Bug Fixes 🐛
  • v1.11.0
  • Exciting New Features 🎉
  • Enhancements 🚀
    • Breaking Changes 🛠
    • Bug Fixes 🐛
  • Upgrade Guide
    • Updating Dependencies
    • 2. Remove deprecated methods
  • New Content
    • Orm add model events
    • Cache add and optimize methods
    • Route supports Fallback route
    • Orm adds new methods
    • Optimize facades.Config.Add()
    • Change Sqlite driver
    • contracts/http add method mapping of net/http
    • Route Add Resource Routing
    • Request Add New Methods
    • Storage Add New Methods
    • File Add New Methods
    • Fix The Error Of Incorrect Windows Path For Filesystem
    • Fix The Panic Of The Header Method For Request
    • Fix The Data Error Of Using Request.Input() And Request.Bind() At The Same Time
    • The problem of process interruption caused by panic in Schedule
    • The problem that DailyAt in Schedule will be executed every minute

v1.11.3

Bug Fixes 🐛

  • The problem of process interruption caused by panic in Schedule
  • The problem that DailyAt in Schedule will be executed every minute

v1.11.2

Bug Fixes 🐛

  • Fix the data error of using Request.Input() and Request.Bind() at the same time

v1.11.1

Exciting New Features 🎉

  • Route add resource routing
  • Request add new methods
  • Storage add new methods
  • File add new methods

Bug Fixes 🐛

  • Fix the error of incorrect windows path for Filesystem
  • Fix the panic of the Header method for Request

v1.11.0

Exciting New Features 🎉

  • Orm add model events(1.11.0)

Enhancements 🚀

  • Cache add and optimize methods(1.11.0)
  • Route supports Fallback route(1.11.0)
  • Orm adds new methods(1.11.0)
  • Optimize facades.Config.Add()(1.11.0)
  • Change Sqlite driver(1.11.0)
  • contracts/http add method mapping of net/http(1.11.0)

Breaking Changes 🛠

  • Orm removes methods(1.11.0)

Bug Fixes 🐛

  • The problem that the hashing configuration does not take effect under some situations(1.11.0)
  • Non-thread safety problems in RateLimiter(1.11.0)

Upgrade Guide

Please upgrade the framework step by step according to the content in this section.

Estimated Upgrade Time: 1 Minutes

Updating Dependencies

Update dependencies in the go.mod file:

go get -u github.com/goravel/framework@v1.11.0 && go mod tidy
go get -u github.com/goravel/framework@v1.11.0 && go mod tidy

2. Remove deprecated methods

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

// Deprecated
database.NewGormInstance()
// Replace with(Note: This method is not recommended, please try not to use it)
gorm.New()

// Deprecated
facades.Orm.Query().Updates()
// Replace with(Only modify the method name is fine, no need to modify the parameters)
facades.Orm.Query().Update()

// The Update method changes return value
// Before
err := facades.Orm.Query().Update()
// After
res, err := facades.Orm.Query().Update()

New Content

This section does not involve code changes, only enhancements.

Orm add model events

Version: v1.10.1

Orm models dispatch several events, allowing you to hook into the following moments in a model's lifecycle: Retrieved, Creating, Created, Updating, Updated, Saving, Saved, Deleting, Deleted, ForceDeleting, ForceDeleted.

For Detail

Cache add and optimize methods

Version: v1.10.1

New Methods

MethodsAction
DecrementDecrement
IncrementIncrement
LockAtomic Locks
StoreAccessing Multiple Cache Stores

Optimize methods

Get, GetBool, GetInt, GetInt64, GetString, Pull no longer need to pass a default value(Backwards compatible).

Route supports Fallback route

Version: v1.10.1

You may define a route that will be executed when no other route matches the incoming request.

facades.Route.Fallback(func(ctx http.Context) http.Response {
  return ctx.Response().String(404, "not found")
})

Orm adds new methods

Version: v1.10.1

MethodAction
db.RawRaw Expressions
LockForUpdatePessimistic Locking
SharedLockPessimistic Locking

Optimize facades.Config.Add()

Version: v1.11.0

The configuration parameter of facades.Config.Add() changes to any from map[string]any, make configuration more flexible.

For Detail

Change Sqlite driver

Because github.com/mattn/go-sqlite3 requires CGO to be started, so replacing a third-party package that does not require CGO: github.com/glebarez/go-sqlite.

contracts/http add method mapping of net/http

Version: v1.11.0

You can use http.MethodGet in controller directly, instead of import net/http.

For Detail

Route Add Resource Routing

Version: v1.11.1

facades.Route.Resource("/resource", resourceController)

For Detail

Request Add New Methods

Version: v1.11.1

MethodAction
AllRetrieving all input data
HostRetrieving the request HOST
QueriesRetrieving input from the query string

About to be deprecated the Form, Json methods, please use Input instead.

Storage Add New Methods

Version: v1.11.1

MethodAction
LastModifiedGet the last modified time of file
MimeTypeGet the mime type of file

File Add New Methods

Version: v1.11.1

MethodAction
LastModifiedGet the last modified time of file
MimeTypeGet the mime type of file
SizeGet the size of file

Fix The Error Of Incorrect Windows Path For Filesystem

Version: v1.11.1

There is a wrong slash in windows system.

Fix The Panic Of The Header Method For Request

Version: v1.11.1

ctx.Request().Header( key: "token") will panic.

Fix The Data Error Of Using Request.Input() And Request.Bind() At The Same Time

Version: v1.11.2

Request.Input() will clear Request.Body, if you use Request.Bind() after that, you will not be able to get the data correctly.

The problem of process interruption caused by panic in Schedule

Version: v1.11.3

The Schedule process will interruption when occurring panic, all tasks wil lbe affected.

The problem that DailyAt in Schedule will be executed every minute

Version: v1.11.3

Fix the problem that DailyAt will be executed every minute:

func (kernel *Kernel) Schedule() []schedule.Event {
  return []schedule.Event{
    facades.Schedule.Call(func() {
      fmt.Print("1")
    }).DailyAt("18:00"),
  }
}
Edit this page