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.10 From v1.9

  • Exciting New Features ๐ŸŽ‰
  • Enhancements ๐Ÿš€
  • Breaking Changes ๐Ÿ› 
  • Upgrade Guide
    • Updating Dependencies
    • Encryption
    • Hashing
    • Add Rate Limiting For Routing
    • Optimize HTTP startup mode
    • Optimize GRPC startup mode
    • Add configuration to control log output to console
    • Request modify and add methods
    • Queue support delayed dispatching
    • The Connection in ORM supports set table prefix and singular
    • Add docker-compose.yml file
    • Optimize Orm
    • Support multiple SQL in migration file
    • Add minio driver for File Storage
    • contracts/http add status mapping of net/http
    • APP_KEY required
    • Add ctx parameter to the methods under Form Request
    • facades.Auth.Parse add payload returns
    • Some methods of Orm add new return values

Exciting New Features ๐ŸŽ‰

  • Add facades.Crypt(1.10.0)
  • Add facades.Hash(1.10.0)
  • Add Rate Limiting For Routing(1.10.0)

Enhancements ๐Ÿš€

  • Optimize HTTP startup mode(1.10.0)
  • Optimize GRPC startup mode(1.10.0)
  • Add configuration to control log output to console(1.10.0)
  • Request modify and add methods(1.10.0)
  • Queue support delayed dispatching(1.10.0)
  • The Connection in ORM supports set table prefix and singular(1.10.0)
  • Add docker-compose.yml file(1.10.0)
  • Optimize Orm(1.10.0)
  • Support multiple SQL in migration file(1.10.0)
  • Add minio driver for File Storage(1.10.0)
  • contracts/http add status mapping of net/http(1.10.0)

Breaking Changes ๐Ÿ› 

  • APP_KEY required(1.10.0)
  • Add ctx parameter to the methods under Form Request(1.10.0)
  • facades.Auth.Parse adds payload returns(1.10.0)
  • Some methods of Orm add new return values(1.10.0)

Upgrade Guide

Estimated Upgrade Time: 20 Minutes

Updating Dependencies

Update dependencies in the go.mod file:

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

Encryption

Version: v1.10.0

Add facades.Crypt:

  1. add &crypt.ServiceProvider{} to the providers item in the config/app.go file;

For Detail

Hashing

Version: v1.10.0

Add facades.Hash:

  1. add &hash.ServiceProvider{} to the providers item in the config/app.go file;

  2. Add config/hashing.go file;

For Detail

Add Rate Limiting For Routing

Version: v1.10.0

For Detail

Optimize HTTP startup mode

Version: v1.10.0

  1. Add config/http.go configuration, For Detail;
  2. The facades.Route.Run method no longer needs to pass parameters, by default use http.host and http.port(you don't need to modify the code, it's backward compatible);
  3. The facades.Route.RunTLS method no longer needs to pass parameters, by default use http.tls.host, http.tls.port, http.tls.ssl.cert and http.tls.ssl.key, if you are using it, you need to modify the code;
  4. Add facades.Route.RunTLSWithCert method, For Detail;
  5. Move app.url, app.host to http.url, http.host;

Optimize GRPC startup mode

Version: v1.10.0

The facades.Grpc.Run method no longer needs to pass parameters, by default use grpc.host and grpc.port(you don't need to modify the code, it's backward compatible);

Add configuration to control log output to console

Version: v1.10.0

Add print configuration to single, daily channel in the config/logging.go file, it can control log output to console, For Detail;

Request modify and add methods

Version: v1.10.0

  1. The Input method is changed from only getting routing parameters to getting data according to the following order: json, form, query, routeใ€‚Note: json can only get one-dimensional data, otherwise it will return empty;
  2. Add Route method to replace the original Input method;
  3. The default value of Query and Form methods are modified to be unnecessary;
  4. Add methods as shown below:
MethodAction
RouteRetrieving An Route Value
RouteIntRetrieving An Route Value
RouteInt64Retrieving An Route Value
QueryIntRetrieving Input From The Query String
QueryInt64Retrieving Input From The Query String
QueryBoolRetrieving Input From The Query String
InputIntRetrieving An Input Value
InputInt64Retrieving An Input Value
InputBoolRetrieving An Input Value
JsonRetrieving Json

Queue support delayed dispatching

Version: v1.10.0

Add Delay method, For Detail

The Connection in ORM supports set table prefix and singular

Version: v1.10.0

  1. Model supports specify table name, For Detail;
  2. Add new keys to connection of config/database.go:

prefix: Set prefix for table name; singular: Set the table name to use singular or plural;

For Detail

Add docker-compose.yml file

Version: v1.10.0

You can quickly start the service with the following command:

docker-compose build
docker-compose up

Optimize Orm

Version: v1.10.0

  1. Add the following methods:
FunctionsAction
FirstOrQuery or return data through callback
FirstOrNewRetrieving Or New Models
FirstOrFailNot Found Error
UpdateOrCreateUpdate or create
  1. An error was reported like this before, but now it's supported:
query := facades.Orm.Query()
query = query.Where()

Support multiple SQL in migration file

Version: v1.10.0

Previously, only one SQL statement was supported in the migration file, but now multiple statements are supported.

Add minio driver for File Storage

Version: v1.10.0

Add minio configuration, For Detail.

contracts/http add status mapping of net/http

Version: v1.10.0

You can use status codes such as http.StatusOK directly in controller without importing net/http.

For Detail

APP_KEY required

Version: v1.10.0

The APP_KEY in the .env file is changed to required, you can run command to generate the APP_KEY: go run . artisan key:generate.

Add ctx parameter to the methods under Form Request

Version: v1.10.0

Add ctx http.Context parameter to the methods under Form Request: Rules, Messages, Attributes, PrepareForValidation, allows you to do more custom configurations.

For Detail

facades.Auth.Parse add payload returns

Version: v1.10.0

err := facades.Auth.Parse(ctx, token) change to payload, err := facades.Auth.Parse(ctx, token), through payload you can get:

  1. Guard: Current Guard;
  2. Key: User flag;
  3. ExpireAt: Expire time;
  4. IssuedAt: Issued time;

For Detail

Some methods of Orm add new return values

Version: v1.10.0

The following methods add *Result return value to get the number of affected rows:

res, err := query.Delete(&user)
res, err := query.Exec(fmt.Sprintf("DELETE FROM users where id = %d", user.ID))
res, err := query.ForceDelete(&User{})
res, err := query.Updates(User{Avatar: "avatar"})

// Affected rows
num := res.RowsAffected
Edit this page