Skip to content

Commit

Permalink
Feature Flysystem v3
Browse files Browse the repository at this point in the history
  • Loading branch information
StanBarrows committed Dec 23, 2022
1 parent b331dab commit a51f4d8
Show file tree
Hide file tree
Showing 14 changed files with 470 additions and 319 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
32 changes: 32 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: dependabot-auto-merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
name: Check & fix styling
name: Fix PHP code style issues

on: [push]

jobs:
php-cs-fixer:
php-code-styling:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga:3.0.0
with:
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@1.0.0

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v1

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
19 changes: 13 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.0]
laravel: [8.*]
php: [8.1]
laravel: [9.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: ^6.6
- laravel: 9.*
testbench: 7.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -44,4 +44,11 @@ jobs:
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit --exclude-group=Integration
run: cp phpunit.xml.dist phpunit.xml

- name: Execute tests
run: vendor/bin/pest
env:
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ psalm.xml
testbench.yaml
vendor
node_modules
phpstan.neon
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

All notable changes to `laravel-cloudinary` will be documented in this file.

## 2.0.0 - 2022-11-20

laravel-flysystem v3 upgrade:

## 1.1.0 - 2022-03-16

- Laravel 9 Support

## 1.0.4 - 2021-12-30

- Bumped Version "friendsofphp/php-cs-fixer": "3.*",

## 1.0.3 - 2021-06-30

- 🐛 Bug Fix: Delete file works with all resource types.

## 1.0.3 - 2021-06-30

- 🐛 Bug Fix: Delete file works with all resource types.
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ additional parameters to your url 😉

## 🛠 Requirements

- PHP: `^8.0`
- Laravel: `^8.12`
- league/flysystem: `^1.1` (default in Laravel 8)
- Cloudinary Account

| Package | PHP | Laravel | Flysystem |
|-----------|--------|-------------|-------------|
| >v2.0 | >8.1 | > Laravel 9 | > 3.0 |
| >v1.0 | >8.0 | > Laravel 8 | > 1.1 |

## ⚙️ Installation

You can install the package via composer:
Expand Down Expand Up @@ -93,12 +95,12 @@ To customize the name of the stored file, you may use the `storeAs` methods
of the `Image` field:

```php
use Illuminate\Http\Request;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Fields\Image;

Image::make('Image')
->disk('cloudinary')
->storeAs(function (Request $request) {
->storeAs(function (NovaRequest $request) {
return sha1($request->image->getClientOriginalName());
}),
```
Expand Down
39 changes: 21 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,31 @@
"homepage": "https://github.com/codebar-ag/laravel-flysystem-cloudinary",
"license": "MIT",
"authors": [
{
"name": "Ruslan Steiger",
"email": "ruslan.steiger@codebar.ch",
"role": "Developer"
},
{
"name": "Sebastian Fix",
"email": "sebastian.fix@codebar.ch",
"role": "Developer"
"homepage": "https://www.codebar.ch",
"role": "Software Engineer"
}
],
"require": {
"php": "^8.0",
"friendsofphp/php-cs-fixer": "3.*",
"php": "^8.1",
"guzzlehttp/guzzle": "^7.0.1",
"illuminate/contracts": "^8.0 || ^9.0",
"spatie/laravel-package-tools": "^1.4.3",
"cloudinary/cloudinary_php": "^2.2.0"
"illuminate/contracts": "^9.0",
"spatie/laravel-package-tools": "^1.9.2",
"cloudinary/cloudinary_php": "^2.9.0"
},
"require-dev": {
"brianium/paratest": "^6.2",
"nunomaduro/collision": "^5.3",
"orchestra/testbench": "^6.15",
"phpunit/phpunit": "^9.3",
"spatie/laravel-ray": "^1.18.0",
"vimeo/psalm": "^4.4"
"laravel/pint": "^1.0",
"nunomaduro/collision": "^6.0",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5"
},
"autoload": {
"psr-4": {
Expand All @@ -55,7 +54,11 @@
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
}
},
"extra": {
"laravel": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
verbose="true"
>
<testsuites>
<testsuite name="CodebarAg Test Suite">
<testsuite name="codebar Solutions AG Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
Loading

0 comments on commit a51f4d8

Please sign in to comment.