Upgrading To v1.12 From v1.11
Last updated
Last updated
[[toc]]
Please upgrade the framework step by step according to the content in this section.
Estimated Upgrade Time: 30 Minutes
Update dependencies in the go.mod
file:
There is an error after running go mod tidy
, the error will be solved after performing the following upgrade steps.
bootstrap/app.go
facades.Artisan
facades.Artisan()
facades.Auth
facades.Auth()
facades.Cache
facades.Cache()
facades.Config
facades.Config()
facades.Crypt
facades.Crypt()
facades.Event
facades.Event()
facades.Gate
facades.Gate()
facades.Grpc
facades.Grpc()
facades.Hash
facades.Hash()
facades.Log
facades.Log()
facades.Mail
facades.Mail()
facades.Orm
facades.Orm()
facades.Queue
facades.Queue()
facades.RateLimiter
facades.RateLimiter()
facades.Route
facades.Route()
facades.Schedule
facades.Schedule()
facades.Storage
facades.Storage()
facades.Validation
facades.Validation()
app/providers/*
Add import for all files:
All of Register
, Boot
methods Add app foundation.Application
input parameter:
app/config/app.go
Modify import:
The items in the []command.Flag
add &command.StringFlag
type:
In order to reduce the loading of unnecessary third packages, reduce package volume, and improve compilation efficiency, Goravel will gradually strip each module driver into an independent expansion packages. In this upgrade, the Filesystem
module cancels the default support for S3
, OSS
, COS
, Minio
drivers, and transfers support to independent extension packages.
Removes keys in config/filesystems.go::disks
except local
and drivers which are using:
If you are using other drivers expect local
, please refer to the corresponding driver documentation for installation:
S3
https://github.com/goravel/s3
OSS
https://github.com/goravel/oss
COS
https://github.com/goravel/cos
Minio
https://github.com/goravel/minio
Remove the redis
key in config/cache.go::stores
if you are not using it:
If you are using the redis
driver, please refer to the redis
driver documentation for installation:
Redis
https://github.com/goravel/redis
In order to make the time type more standard in API output, the type of CreatedAt
, UpdatedAt
in Model
change to carbon.DateTime
from time.Time
. If you have additional processing for these two fields, you can get the original time.Time
type through the CreatedAt.ToStdTime()
method.
Check the zero value in the original validate rule, for example, if the rule is set to date
and required
is not set, and the field is empty or not passed, the validation module will prompt that field is required. After optimization, the validation module will passed the check, which is more intuitive to use. If you are using relevant validation, please ensure that the upgrade is as expected.
Run go mod tidy
Version: v1.12.0
Version: v1.12.0
Version: v1.12.0
Version: v1.12.0
Version: v1.12.0
To provide better feature support, the versions of all packages that Goravel depends on have been upgraded.
Version: v1.12.0
migrate:fresh
Drop all tables and re-run all migrations
migrate:refresh
Reset and re-run all migrations
migrate:reset
Rollback all database migrations
migrate:status
Show the status of each migration
make
Commands Support SubdirectoriesVersion: v1.12.0
make:policy User/AuthPolicy
app/policies/User/auth_policy.go
make:command Goravel/CleanCache
app/console/commands/Goravel/clean_cache.go
make:model User/Phone
app/models/User/phone.go
make:observer User/PhoneObserver
app/observers/User/phone_observer.go
make:event User/GoravelEvent
app/events/User/goravel_event.go
make:listener User/GoravelListen
app/listeners/User/goravel_listen.go
make:controller User/AuthController
app/http/controllers/User/auth_controller.go
make:middleware User/Auth
app/http/middleware/User/auth.go
make:request User/Auth
app/http/requests/User/auth.go
make:job Goravel/Job
app/jobs/Goravel/job.go
make:rule User/Phone
app/rules/User/phone.go
Version: v1.12.1
Fix the panic problem caused by backslash when the make
command automatically creates folders under Windows.
Version: v1.12.2
Fix the problem of facades.Gate()
return nil.
Version: v1.12.3
The file created by the make:package
command has a wrong path under Windows.
Version: v1.12.4
Fix the problem of the throttle middleware throw panic.
All services in Goravel are registered in the service container, providing strong support for the package development,
Packages are the primary way of adding functionality to Goravel, can enrich the ecology of Goravel,
Add methods for Artisan module to get different types of Flag
,
Add path
and carbon
Helpers methods, you can easily get the path information and deal with time in project, 。