-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from goravel/bowen/upgrade-framework
chore: Upgarde framework v1.13.1
- Loading branch information
Showing
6 changed files
with
256 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
permissions: | ||
contents: write | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 'stable' | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,60 @@ | ||
# cloudinary | ||
|
||
A cloudinary driver for `facades.Storage()` of Goravel. | ||
|
||
## Version | ||
|
||
| goravel/cloudinary | cloudinary | goravel/framework | | ||
|--------------------|------------|-------------------| | ||
| v1.0.0 | v2.3.0 | v1.12.0 | | ||
| v1.1.* | v2.4.0 | v1.13.* | | ||
|
||
## Install | ||
|
||
1. Add package | ||
```bash | ||
go get github.com/goravel/cloudinary | ||
``` | ||
|
||
```bash | ||
go get github.com/goravel/cloudinary | ||
``` | ||
|
||
2. Register service provider | ||
``` | ||
// config/app.go | ||
import "github.com/goravel/cloudinary" | ||
|
||
"providers": []foundation.ServiceProvider{ | ||
... | ||
&cloudinary.ServiceProvider{}, | ||
} | ||
``` | ||
|
||
``` | ||
// config/app.go | ||
import "github.com/goravel/cloudinary" | ||
"providers": []foundation.ServiceProvider{ | ||
... | ||
&cloudinary.ServiceProvider{}, | ||
} | ||
``` | ||
|
||
3. Add cloudinary disk to `config/filesystems.go` file | ||
```go | ||
// config/filesystems.go | ||
... | ||
import ( | ||
cloudinaryfacades "github.com/goravel/cloudinary/facades" | ||
"github.com/goravel/framework/filesystem" | ||
) | ||
"disks": map[string]filesystem.Disk{ | ||
... | ||
"cloudinary": map[string]any{ | ||
"driver": "custom", | ||
"cloud": config.Env("CLOUDINARY_CLOUD"), | ||
"key": config.Env("CLOUDINARY_ACCESS_KEY_ID"), | ||
"secret": config.Env("CLOUDINARY_ACCESS_KEY_SECRET"), | ||
// resource_types is optional | ||
// it is used to limit the types of files that can be uploaded to cloudinary disk | ||
"resource_types": map[string][]string{ | ||
"image": {"png"}, | ||
"video": {}, | ||
"raw": {"txt", "pdf"}, | ||
}, | ||
"via": func()(filestystem.Disk, error) { | ||
return cloudinaryfacades.Cloudinary("cloudinary"), nil // The `cloudinary` value is the `disks` key | ||
}, | ||
} | ||
} | ||
``` | ||
```go | ||
// config/filesystems.go | ||
... | ||
|
||
import ( | ||
cloudinaryfacades "github.com/goravel/cloudinary/facades" | ||
"github.com/goravel/framework/filesystem" | ||
) | ||
|
||
"disks": map[string]filesystem.Disk{ | ||
... | ||
"cloudinary": map[string]any{ | ||
"driver": "custom", | ||
"cloud": config.Env("CLOUDINARY_CLOUD"), | ||
"key": config.Env("CLOUDINARY_ACCESS_KEY_ID"), | ||
"secret": config.Env("CLOUDINARY_ACCESS_KEY_SECRET"), | ||
// resource_types is optional | ||
// it is used to limit the types of files that can be uploaded to cloudinary disk | ||
"resource_types": map[string][]string{ | ||
"image": {"png"}, | ||
"video": {}, | ||
"raw": {"txt", "pdf"}, | ||
}, | ||
"via": func()(filestystem.Disk, error) { | ||
return cloudinaryfacades.Cloudinary("cloudinary"), nil // The `cloudinary` value is the `disks` key | ||
}, | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.