Skip to content

Commit

Permalink
Laravel 11 Update
Browse files Browse the repository at this point in the history
Laravel 11 Update
  • Loading branch information
RhysLees authored Apr 11, 2024
1 parent c9e945e commit c31fb16
Show file tree
Hide file tree
Showing 13 changed files with 163 additions and 127 deletions.
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bug Report
description: Report an Issue or Bug with the Package
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
We're sorry to hear you have a problem. Can you help us solve it by providing the following details.
- type: textarea
id: what-happened
attributes:
label: What happened?
description: What did you expect to happen?
placeholder: I cannot currently do X thing because when I do, it breaks X thing.
validations:
required: true

- type: input
id: package-version
attributes:
label: Package Version
description: What version of our Package are you running? Please be as specific as possible
placeholder: 2.0.0
validations:
required: true
- type: input
id: php-version
attributes:
label: PHP Version
description: What version of PHP are you running? Please be as specific as possible
placeholder: 8.2.0
validations:
required: true
- type: input
id: laravel-version
attributes:
label: Laravel Version
description: What version of Laravel are you running? Please be as specific as possible
placeholder: 9.0.0
validations:
required: true
- type: dropdown
id: operating-systems
attributes:
label: Which operating systems does with happen with?
description: You may select more than one.
multiple: true
options:
- macOS
- Windows
- Linux
21 changes: 21 additions & 0 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Fix PHP code style issues

on: [push]

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

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

- name: Fix PHP code style issues
uses: aglipanci/[email protected]

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix styling
29 changes: 0 additions & 29 deletions .github/workflows/php-cs-fixer.yml

This file was deleted.

71 changes: 35 additions & 36 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,59 @@
name: run-tests

on: [push, pull_request]
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
max-parallel: 1
matrix:
os: [ubuntu-latest]
php: [7.2, 7.3, 7.4, 8.0]
laravel: [6, 7, 8]
dependency-version: [prefer-lowest, prefer-stable]
os: [ ubuntu-latest, windows-latest ]
php: [ 8.2, 8.3 ]
laravel: [ 11.* ]
stability: [ prefer-lowest, prefer-stable ]
include:
- laravel: 8
testbench: 6.*
- laravel: 7
testbench: 5.*
- laravel: 6
testbench: 4.*
exclude:
- laravel: 6
php: 8.0
- laravel: 7
php: 8.0
- laravel: 8
php: 7.2
- laravel: 8
php: 7.3
- laravel: 8
php: 8.0
dependency-version: prefer-lowest

name: P${{ matrix.php }} - L${{ matrix.laravel }}.* - ${{ matrix.dependency-version }} - ${{ matrix.os }}
- laravel: 11.*
testbench: 9.*

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

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

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

- 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
coverage: pcov
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: xdebug

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.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
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
- name: Set phpunit.xml
run: cp phpunit.xml.dist phpunit.xml

- name: Execute tests
run: vendor/bin/phpunit

- name: Store test reports
uses: actions/upload-artifact@v2
with:
name: Store report
retention-days: 1
path: |
./reports
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
.idea
.phpunit.result.cache
.phpunit.cache
build
composer.lock
coverage
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ using Prerender.io since the response always goes through your server.
## 🛠 Requirements

- PHP: `^7.2`
- Laravel: `^6`
- Prerender.io access

| Package | PHP | Laravel | Prerender.io access |
|:-------:|:-----------:|:-------:|:-------------------:|
| main | ^8.2 - ^8.3 | 11.x ||
| v3.3.0 | ^8.1 - ^8.3 | 10.x ||
| v3.2.0 | ^8.0 - ^8.2 | 9.x ||
| v3.1.1 | ^7.3 - ^8.1 | 8.x ||


## ⚙️ Installation

Expand Down
19 changes: 11 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
}
],
"require": {
"php": ">=7.2",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
"guzzlehttp/guzzle": "^6.0|^7.0",
"symfony/psr-http-message-bridge": "^1.3|^2.0"
"php": "^8.2|^8.3",
"guzzlehttp/guzzle": "^7.8",
"illuminate/support": "^11.0",
"symfony/psr-http-message-bridge": "^7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "3.0.0",
"orchestra/testbench": "^4.0|^5.0|^6.0",
"phpunit/phpunit": "^8.4|^9.0"
"friendsofphp/php-cs-fixer": "^3.50",
"orchestra/testbench": "^9.0",
"phpunit/phpunit": "^10.5"
},
"autoload": {
"psr-4": {
Expand All @@ -54,7 +54,10 @@
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes --config=.php-cs-fixer.dist.php"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"extra": {
"laravel": {
Expand Down
4 changes: 2 additions & 2 deletions config/prerender.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
'*.ttf',
'*.otf',
'*.woff',
'*.woff2'
'*.woff2',
],

/*
Expand Down Expand Up @@ -178,7 +178,7 @@
'nuzzel',
'Discordbot',
'Google Page Speed',
'Qwantify'
'Qwantify',
],

];
58 changes: 21 additions & 37 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,39 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="CodebarAg Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="CodebarAg Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
4 changes: 2 additions & 2 deletions src/LaravelPrerenderServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class LaravelPrerenderServiceProvider extends ServiceProvider
public function boot(): void
{
$this->publishes([
__DIR__ . '/../config/prerender.php' => config_path('prerender.php'),
__DIR__.'/../config/prerender.php' => config_path('prerender.php'),
], 'config');

if (config('prerender.enable')) {
Expand All @@ -30,7 +30,7 @@ public function boot(): void
public function register(): void
{
$this->mergeConfigFrom(
__DIR__ . '/../config/prerender.php',
__DIR__.'/../config/prerender.php',
'prerender'
);
}
Expand Down
Loading

0 comments on commit c31fb16

Please sign in to comment.