diff --git a/.editorconfig b/.editorconfig index cd8eb86..665acc3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,3 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://editorconfig.org - root = true [*] @@ -13,3 +10,6 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index bb6265e..9e9519b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,10 +2,18 @@ # https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html # Ignore all test and documentation with "export-ignore". +/.github export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.travis.yml export-ignore /phpunit.xml.dist export-ignore -/.scrutinizer.yml export-ignore +/art export-ignore +/docs export-ignore /tests export-ignore /.editorconfig export-ignore +/.php_cs.dist.php export-ignore +/psalm.xml export-ignore +/psalm.xml.dist export-ignore +/testbench.yaml export-ignore +/UPGRADING.md export-ignore +/phpstan.neon.dist export-ignore +/phpstan-baseline.neon export-ignore diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0bc378d --- /dev/null +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..d4c0b65 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -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@v2 + 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}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c6bce74 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: "Release" + +on: + release: + types: [released] + +jobs: + update: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: main + + - name: Update Changelog + uses: stefanzweifel/changelog-updater-action@v1 + with: + latest-version: ${{ github.event.release.name }} + release-notes: ${{ github.event.release.body }} + + - name: Commit updated CHANGELOG + uses: stefanzweifel/git-auto-commit-action@v5 + with: + branch: main + commit_message: Update CHANGELOG + file_pattern: CHANGELOG.md diff --git a/.gitignore b/.gitignore index 808f8c5..9a43686 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,14 @@ +.idea +.php_cs +.php_cs.cache +.phpunit.result.cache build composer.lock +coverage docs +phpunit.xml +phpstan.neon +testbench.yaml vendor -coverage \ No newline at end of file +node_modules +.php-cs-fixer.cache diff --git a/README.md b/README.md index a914322..e13ac95 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,20 @@ composer require beyondcode/laravel-favicon The service provider for this package will be automatically registered for you. +### Compatibility + +| | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | +|-------|-----|-----|-----|-----|-----|-----|-----| +| 5.6.x | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| 5.7.x | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| 5.8.x | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| 6.x | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| 7.x | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | +| 8.x | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | +| 9.x | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | +| 10.x | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | +| 11.x | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | + ## Usage To make use of this package, make use of the `favicon` helper function that this package provides. @@ -37,7 +51,7 @@ You can simply wrap the function around your favicon icon names, like this: ``` -## Customization +### Customization You can completely customize which environments you want to have enabled for the favicon generation, as well as the font and colors that will be used. @@ -87,7 +101,7 @@ return [ /* * Intervention Image supports "GD Library" and "Imagick" to process images * internally. You may choose one of them according to your PHP - * configuration. By default PHP's "GD Library" implementation is used. + * configuration. By default, PHP's "GD Library" implementation is used. * * If you want to convert ICO files, you need to use imagick. * @@ -136,15 +150,15 @@ The `shouldGenerateFavicon` method can be used to determine if a custom favicon ## FAQ -- My ICO files are not working, why? +### My ICO files are not working, why? In order to modify ICO files, you need the Imagick PHP library installed and enabled in your `config/favicon.php` file. -- Is there a performance impact when I'm using this package? +### Is there a performance impact when I'm using this package? No - the default generator only modifies your favicon when the specified environment is enabled. This means, that production environments only see the static assets that you already have. -### Changelog +## Changelog Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. @@ -152,7 +166,7 @@ Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recen Please see [CONTRIBUTING](CONTRIBUTING.md) for details. -### Security +## Security If you discover any security related issues, please email marcel@beyondco.de instead of using the issue tracker. diff --git a/composer.json b/composer.json index d1d6a87..5785876 100644 --- a/composer.json +++ b/composer.json @@ -16,14 +16,14 @@ } ], "require": { - "php": "^7.1|^8.0|^8.1|^8.2", - "illuminate/http": "5.6.*|5.7.*|5.8.*|6.*|7.*|8.*|9.*|^10.0", - "illuminate/support": "5.6.*|5.7.*|5.8.*|6.*|7.*|8.*|9.*|^10.0", + "php": "^7.1|^8.0|^8.1|^8.2|^8.3", + "illuminate/http": "5.6.*|5.7.*|5.8.*|6.*|7.*|8.*|9.*|^10.0|^11.0", + "illuminate/support": "5.6.*|5.7.*|5.8.*|6.*|7.*|8.*|9.*|^10.0|^11.0", "intervention/image": "^2.4" }, "require-dev": { - "phpunit/phpunit": "^7.0|^8.0|^9.0", - "orchestra/testbench": "^3.7|^4.0|^5.0|^6.0|^7.0" + "phpunit/phpunit": "^7.0|^8.0|^9.0|^10.0|^11.0", + "orchestra/testbench": "^3.7|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0" }, "autoload": { "psr-4": { diff --git a/config/favicon.php b/config/favicon.php index 0eb0d79..3c45c7e 100644 --- a/config/favicon.php +++ b/config/favicon.php @@ -35,7 +35,7 @@ /* * Intervention Image supports "GD Library" and "Imagick" to process images * internally. You may choose one of them according to your PHP - * configuration. By default PHP's "GD Library" implementation is used. + * configuration. By default, PHP's "GD Library" implementation is used. * * If you want to convert ICO files, you need to use imagick. *