Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11.x Compatibility #12

Merged
merged 4 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 84 additions & 76 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,97 @@
name: run-tests

on: [push, pull_request]
on:
- push
- pull_request

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.3, 8.2, 8.1]
laravel: [10.*]
db: [mysql, postgres, sqlite]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
test:
runs-on: ubuntu-latest

name: P${{ matrix.php }} - L${{ matrix.laravel }} - DB ${{ matrix.db }} - ${{ matrix.dependency-version }}
strategy:
fail-fast: true
matrix:
php: [8.3, 8.2, 8.1]
laravel: ["10.*", "11.*"]
db: [mysql, postgres, sqlite]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 11.*
php: 8.1

services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: no
MYSQL_USER: protone_media_db_test
MYSQL_DATABASE: protone_media_db_test_mysql
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:10.8
env:
POSTGRES_USER: protone_media_db_test
POSTGRES_PASSWORD: secret
POSTGRES_DB: protone_media_db_test_postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
name: P${{ matrix.php }} - L${{ matrix.laravel }} - DB ${{ matrix.db }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v2
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: no
MYSQL_USER: protone_media_db_test
MYSQL_DATABASE: protone_media_db_test_mysql
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:10.8
env:
POSTGRES_USER: protone_media_db_test
POSTGRES_PASSWORD: secret
POSTGRES_DB: protone_media_db_test_postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql
coverage: none
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql
coverage: none

- name: Execute tests (MySQL)
run: vendor/bin/phpunit
if: ${{ matrix.db == 'mysql' }}
env:
DB_DATABASE: protone_media_db_test_mysql
DB_USERNAME: protone_media_db_test
DB_PASSWORD: secret
DB_PORT: ${{ job.services.mysql.ports[3306] }}
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: Execute tests (PostgreSQL)
run: vendor/bin/phpunit
if: ${{ matrix.db == 'postgres' }}
env:
DB_CONNECTION: pgsql
DB_DATABASE: protone_media_db_test_postgres
DB_USERNAME: protone_media_db_test
DB_PASSWORD: secret
DB_PORT: ${{ job.services.postgres.ports[5432] }}
- name: Execute tests (MySQL)
run: vendor/bin/phpunit
if: "${{ matrix.db == 'mysql' }}"
env:
DB_DATABASE: protone_media_db_test_mysql
DB_USERNAME: protone_media_db_test
DB_PASSWORD: secret
DB_PORT: ${{ job.services.mysql.ports[3306] }}

- name: Execute tests (SQLite)
run: vendor/bin/phpunit
if: ${{ matrix.db == 'sqlite' }}
env:
DB_CONNECTION: sqlite
DB_DATABASE: ":memory:"
- name: Execute tests (PostgreSQL)
run: vendor/bin/phpunit
if: "${{ matrix.db == 'postgres' }}"
env:
DB_CONNECTION: pgsql
DB_DATABASE: protone_media_db_test_postgres
DB_USERNAME: protone_media_db_test
DB_PASSWORD: secret
DB_PORT: ${{ job.services.postgres.ports[5432] }}

- name: Execute tests (SQLite)
run: vendor/bin/phpunit
if: "${{ matrix.db == 'sqlite' }}"
env:
DB_CONNECTION: sqlite
DB_DATABASE: ":memory:"
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ Related package: [Laravel Eloquent Where Not](https://github.com/protonemedia/la

❤️ We proudly support the community by developing Laravel packages and giving them away for free. If this package saves you time or if you're relying on it professionally, please consider [sponsoring the maintenance and development](https://github.com/sponsors/pascalbaljet). Keeping track of issues and pull requests takes time, but we're happy to help!

## Laravel Splade

**Did you hear about Laravel Splade? 🤩**

It's the *magic* of Inertia.js with the *simplicity* of Blade. [Splade](https://github.com/protonemedia/laravel-splade) provides a super easy way to build Single Page Applications using Blade templates. Besides that magic SPA-feeling, it comes with more than ten components to sparkle your app and make it interactive, all without ever leaving Blade.

## Blogpost

If you want to know more about the background of this package, please read the blogpost: [Stop duplicating your Eloquent query scopes and constraints. Re-use them as select statements with a new Laravel package](https://protone.media/blog/stop-duplicating-your-eloquent-query-scopes-and-constraints-re-use-them-as-select-statements-with-a-new-laravel-package).
Expand Down Expand Up @@ -275,14 +269,15 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Other Laravel packages

* [`Laravel Analytics Event Tracking`](https://github.com/protonemedia/laravel-analytics-event-tracking): Laravel package to easily send events to Google Analytics.
* [`Laravel Blade On Demand`](https://github.com/protonemedia/laravel-blade-on-demand): Laravel package to compile Blade templates in memory.
* [`Laravel Cross Eloquent Search`](https://github.com/protonemedia/laravel-cross-eloquent-search): Laravel package to search through multiple Eloquent models.
* [`Laravel FFMpeg`](https://github.com/protonemedia/laravel-ffmpeg): This package provides an integration with FFmpeg for Laravel. The storage of the files is handled by Laravel's Filesystem.
* [`Laravel Form Components`](https://github.com/protonemedia/laravel-form-components): Blade components to rapidly build forms with Tailwind CSS Custom Forms and Bootstrap 4. Supports validation, model binding, default values, translations, includes default vendor styling and fully customizable!
* [`Laravel MinIO Testing Tools`](https://github.com/protonemedia/laravel-minio-testing-tools): Run your tests against a MinIO S3 server.
* [`Laravel Mixins`](https://github.com/protonemedia/laravel-mixins): A collection of Laravel goodies.
* [`Laravel Paddle`](https://github.com/protonemedia/laravel-paddle): Paddle.com API integration for Laravel with support for webhooks/events.
* [`Laravel Task Runner`](https://github.com/protonemedia/laravel-task-runner): Write Shell scripts like Blade Components and run them locally or on a remote server.
* [`Laravel Verify New Email`](https://github.com/protonemedia/laravel-verify-new-email): This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.
* [`Laravel WebDAV`](https://github.com/protonemedia/laravel-webdav): WebDAV driver for Laravel's Filesystem.
* [`Laravel XSS Protection`](https://github.com/protonemedia/laravel-xss-protection): Laravel Middleware to protect your app against Cross-site scripting (XSS). It sanitizes request input, and it can sanatize Blade echo statements.

### Security

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
],
"require": {
"php": "^8.1|^8.2|^8.3",
"illuminate/support": "^10.0"
"illuminate/support": "^10.0|^11.0"
},
"require-dev": {
"mockery/mockery": "^1.4.4",
"orchestra/testbench": "^8.0",
"orchestra/testbench": "^8.0|^9.0",
"phpunit/phpunit": "^10.4"
},
"autoload": {
Expand All @@ -43,4 +43,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
Loading