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

Add Laravel 11 support #41

Merged
merged 5 commits into from
Mar 9, 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
40 changes: 0 additions & 40 deletions .docker/nginx/app.laravel-optimus.80.conf

This file was deleted.

5 changes: 4 additions & 1 deletion .docker/php/Dockerfile → .docker/php/php81/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# ----------------------
# The FPM base container
# ----------------------
FROM php:8.1-fpm-alpine AS dev
FROM php:8.1-cli-alpine AS dev

RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS

# Cleanup apk cache and temp files
RUN rm -rf /var/cache/apk/* /tmp/*
Expand Down
22 changes: 22 additions & 0 deletions .docker/php/php82/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ----------------------
# The FPM base container
# ----------------------
FROM php:8.2-cli-alpine AS dev

RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS

# Cleanup apk cache and temp files
RUN rm -rf /var/cache/apk/* /tmp/*

# ----------------------
# Composer install step
# ----------------------

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# ----------------------
# The FPM production container
# ----------------------
FROM dev
22 changes: 22 additions & 0 deletions .docker/php/php83/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ----------------------
# The FPM base container
# ----------------------
FROM php:8.3-cli-alpine AS dev

RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS

# Cleanup apk cache and temp files
RUN rm -rf /var/cache/apk/* /tmp/*

# ----------------------
# Composer install step
# ----------------------

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# ----------------------
# The FPM production container
# ----------------------
FROM dev
85 changes: 0 additions & 85 deletions .docker/php/www.conf

This file was deleted.

21 changes: 16 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
name: tests

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

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.0, 8.1, 8.2 ]
laravel: [ 9.*, 10.* ]
dependency-version: [ prefer-lowest, prefer-stable ]
os: [ubuntu-latest]
php: [8.0, 8.1, 8.2, 8.3]
laravel: ['9.*', '10.*', '11.*']
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- laravel: 9.*
php: 8.2
- laravel: 9.*
php: 8.3
- laravel: 10.*
php: 8.0
- laravel: 11.*
php: 8.0
- laravel: 11.*
php: 8.1
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to `cybercog/laravel-optimus` will be documented in this fil

## [Unreleased]

## [3.10.0] - 2024-03-09

### Added

- ([#41]) Added Laravel 11 support

## [3.9.0] - 2023-03-01

### Added
Expand Down Expand Up @@ -118,7 +124,8 @@ All notable changes to `cybercog/laravel-optimus` will be documented in this fil

Initial release

[Unreleased]: https://github.com/cybercog/laravel-optimus/compare/3.9.0...master
[Unreleased]: https://github.com/cybercog/laravel-optimus/compare/3.10.0...master
[3.10.0]: https://github.com/cybercog/laravel-optimus/compare/3.9.0...3.10.0
[3.9.0]: https://github.com/cybercog/laravel-optimus/compare/3.8.0...3.9.0
[3.8.0]: https://github.com/cybercog/laravel-optimus/compare/3.7.0...3.8.0
[3.7.0]: https://github.com/cybercog/laravel-optimus/compare/3.6.0...3.7.0
Expand All @@ -134,6 +141,7 @@ Initial release
[2.1.0]: https://github.com/cybercog/laravel-optimus/compare/2.0.0...2.1.0
[2.0.0]: https://github.com/cybercog/laravel-optimus/compare/1.0.0...2.0.0

[#41]: https://github.com/cybercog/laravel-optimus/pull/41
[#35]: https://github.com/cybercog/laravel-optimus/pull/35
[#32]: https://github.com/cybercog/laravel-optimus/pull/32
[#31]: https://github.com/cybercog/laravel-optimus/pull/31
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
"require": {
"php": "^7.4|^8.0",
"graham-campbell/manager": "^5.0",
"illuminate/contracts": "^8.0|^9.0|^10.0",
"illuminate/support": "^8.0|^9.0|^10.0",
"illuminate/contracts": "^8.0|^9.0|^10.0|^11.0",
"illuminate/support": "^8.0|^9.0|^10.0|^11.0",
"jenssegers/optimus": "^0.2.2"
},
"require-dev": {
"graham-campbell/testbench": "^6.0",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^9.6"
"phpunit/phpunit": "^9.6|^10.5"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -72,5 +72,5 @@
}
},
"minimum-stability": "dev",
"prefer-stable" : true
"prefer-stable": true
}
49 changes: 24 additions & 25 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
version: "3.9"
services:
app:
container_name: laravel-optimus-app
image: laravel-optimus-app
php81:
container_name: laravel-optimus-lib-81
image: laravel-optimus-lib-81
build:
context: ./
dockerfile: ./.docker/php/Dockerfile
restart: unless-stopped
dockerfile: ./.docker/php/php81/Dockerfile
tty: true
working_dir: /app
volumes:
- ./:/app
- ./.docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf:ro
networks:
- laravel-optimus

nginx:
container_name: laravel-optimus-nginx
image: nginx:1.21-alpine
restart: unless-stopped
depends_on:
- app
ports:
- "80:80"
environment:
VIRTUAL_HOST: app.laravel-optimus.localhost
php82:
container_name: laravel-optimus-lib-82
image: laravel-optimus-lib-82
build:
context: ./
dockerfile: ./.docker/php/php82/Dockerfile
tty: true
working_dir: /app
volumes:
- ./.docker/nginx/app.laravel-optimus.80.conf:/etc/nginx/conf.d/app.laravel-optimus.80.conf:ro
- ./public:/app/public:ro
networks:
- laravel-optimus
- ./:/app

networks:
laravel-optimus:
driver: bridge
php83:
container_name: laravel-optimus-lib-83
image: laravel-optimus-lib-83
build:
context: ./
dockerfile: ./.docker/php/php83/Dockerfile
tty: true
working_dir: /app
volumes:
- ./:/app
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">tests/</directory>
<exclude>tests/database/factories/</exclude>
<directory suffix=".php">tests/Unit/</directory>
</testsuite>
</testsuites>
<php>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Cog\Tests\Laravel\Optimus\Facades;
namespace Cog\Tests\Laravel\Optimus\Unit\Facades;

use Cog\Laravel\Optimus\Facades\Optimus;
use Cog\Laravel\Optimus\OptimusManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

declare(strict_types=1);

namespace Cog\Tests\Laravel\Optimus;
namespace Cog\Tests\Laravel\Optimus\Unit;

use Cog\Laravel\Optimus\OptimusFactory;
use Cog\Tests\Laravel\Optimus\AbstractTestCase;
use Jenssegers\Optimus\Optimus;

final class OptimusFactoryTest extends AbstractTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Cog\Tests\Laravel\Optimus;
namespace Cog\Tests\Laravel\Optimus\Unit;

use Cog\Laravel\Optimus\OptimusFactory;
use Cog\Laravel\Optimus\OptimusManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Cog\Tests\Laravel\Optimus\Providers;
namespace Cog\Tests\Laravel\Optimus\Unit\Providers;

use Cog\Laravel\Optimus\OptimusFactory;
use Cog\Laravel\Optimus\OptimusManager;
Expand Down
Loading
Loading