Skip to content

Commit 863d3fd

Browse files
Copilotthibautdegclaudejyrkidn
authored
Add PHP 8.5 / Laravel 13 support (#34)
* Initial plan * Update package for PHP 8.5 and Laravel 13 compatibility Co-authored-by: thibautdeg <71264420+thibautdeg@users.noreply.github.com> * Fix failing GitHub Actions: add workflow permissions, remove unsupported Laravel 13, fix code style Co-authored-by: thibautdeg <71264420+thibautdeg@users.noreply.github.com> * Fix CI failures: remove coverage config, update deprecated Filament methods, update PHPUnit schema - Remove <coverage> and <logging> blocks from phpunit.xml.dist that require a coverage driver not available in CI - Update PHPUnit XSD schema URL from 10.1 to 12.5 to match installed version - Replace deprecated Filament v5 methods: actions() → recordActions(), bulkActions() → toolbarActions() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Change PHP requirement from ^8.4 to ^8.3 * Update test matrix: add PHP 8.3, ensure PHP 8.5 and Laravel 13 * Add ^13.0 to illuminate/contracts constraint * Add ^13.0 to illuminate/contracts constraint * Use dev branches of wotz dependencies for Laravel 13 support * Remove feature branches --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thibautdeg <71264420+thibautdeg@users.noreply.github.com> Co-authored-by: Thibaut Degezelle <thibaut.degezelle1@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Jyrki De Neve <jyrki.deneve@gmail.com>
1 parent 713fa56 commit 863d3fd

19 files changed

Lines changed: 57 additions & 47 deletions

.github/workflows/fix-php-code-style.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Fix PHP code style
22

33
on: [push]
44

5+
permissions:
6+
contents: write
7+
58
jobs:
69
php-code-styling:
710
runs-on: ubuntu-latest

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: "8.4"
19+
php-version: "8.5"
2020
coverage: none
2121

2222
- name: Install composer dependencies

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.2, 8.3, 8.4]
17-
laravel: [10.*, 11.*, 12.*]
16+
php: [8.3, 8.4, 8.5]
17+
laravel: [12.*, 13.*]
1818
stability: [prefer-stable]
1919

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

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"homepage": "https://github.com/wotzebra/filament-seo",
1010
"license": "MIT",
1111
"require": {
12-
"php": "^8.2",
12+
"php": "^8.3",
1313
"filament/filament": "^4.0|^5.0",
14-
"illuminate/contracts": "^10.0|^11.0|^12.0",
14+
"illuminate/contracts": "^12.0|^13.0",
1515
"spatie/laravel-package-tools": "^1.12",
1616
"spatie/laravel-translatable": "^6.5",
1717
"wotz/filament-media-library": "^4.0",
@@ -21,8 +21,8 @@
2121
"require-dev": {
2222
"larastan/larastan": "^2.0|^3.0",
2323
"laravel/pint": "^1.0",
24-
"nunomaduro/collision": "^7.0|^8.0",
25-
"orchestra/testbench": "^8.0|^9.0|^10.0",
24+
"nunomaduro/collision": "^8.0|^9.0",
25+
"orchestra/testbench": "^10.0|^11.0",
2626
"pestphp/pest": "^2.0|^3.0|^4.0",
2727
"pestphp/pest-plugin-laravel": "^2.0|^3.0|^4.0",
2828
"phpstan/extension-installer": "^1.1|^2.0",

config/filament-seo.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?php
22

3+
use Wotz\Seo\Models\SeoRoute;
34
use Wotz\Seo\Tags\Meta;
45
use Wotz\Seo\Tags\OgUrl;
56
use Wotz\Seo\Tags\OpenGraph;
67
use Wotz\Seo\Tags\OpenGraphImage;
78

89
return [
910
'models' => [
10-
'seo-route' => \Wotz\Seo\Models\SeoRoute::class,
11+
'seo-route' => SeoRoute::class,
1112
],
1213
'default' => [
1314
'title_og' => [

phpunit.xml.dist

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
33
<testsuites>
44
<testsuite name="Codedor Test Suite">
55
<directory>tests</directory>
66
</testsuite>
77
</testsuites>
8-
<coverage>
9-
<report>
10-
<html outputDirectory="build/coverage"/>
11-
<text outputFile="build/coverage.txt"/>
12-
<clover outputFile="build/logs/clover.xml"/>
13-
</report>
14-
</coverage>
15-
<logging>
16-
<junit outputFile="build/report.junit.xml"/>
17-
</logging>
188
<php>
199
<server name="APP_KEY" value="base64:llrAPMQL0x08EHCBwf/UkOqptL7p/SXkcTnY2znWurE="/>
2010
</php>

src/Filament/Resources/SeoRouteResource.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace Wotz\Seo\Filament\Resources;
44

5+
use Filament\Actions\EditAction;
56
use Filament\Forms\Components\Checkbox;
67
use Filament\Forms\Components\Textarea;
78
use Filament\Forms\Components\TextInput;
89
use Filament\Resources\Resource;
10+
use Filament\Schemas\Schema;
911
use Filament\Tables\Columns\TextColumn;
1012
use Filament\Tables\Table;
1113
use Illuminate\Database\Eloquent\Model;
@@ -26,7 +28,7 @@ class SeoRouteResource extends Resource
2628

2729
protected static string|\UnitEnum|null $navigationGroup = 'SEO';
2830

29-
public static function form(\Filament\Schemas\Schema $schema): \Filament\Schemas\Schema
31+
public static function form(Schema $schema): Schema
3032
{
3133
return $schema->components([
3234
TranslatableTabs::make()
@@ -73,10 +75,10 @@ static function (SeoRoute $record) {
7375
->filters([
7476
//
7577
])
76-
->actions([
77-
\Filament\Actions\EditAction::make(),
78+
->recordActions([
79+
EditAction::make(),
7880
])
79-
->bulkActions([]);
81+
->toolbarActions([]);
8082
}
8183

8284
public static function getPages(): array

src/Filament/SeoCard.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use Filament\Forms\Components\Textarea;
66
use Filament\Infolists\Components\TextEntry;
7+
use Filament\Schemas\Components\Group;
8+
use Filament\Schemas\Components\Section;
79
use Illuminate\Database\Eloquent\Model;
810
use Wotz\MediaLibrary\Filament\AttachmentInput;
911
use Wotz\Seo\Formats\OgImage;
@@ -12,7 +14,7 @@
1214

1315
class SeoCard
1416
{
15-
public static function make(string $model, ?string $locale = null): \Filament\Schemas\Components\Section
17+
public static function make(string $model, ?string $locale = null): Section
1618
{
1719
$model = app($model);
1820

@@ -31,18 +33,18 @@ public static function make(string $model, ?string $locale = null): \Filament\Sc
3133
->rules($tag->getRules());
3234
});
3335

34-
return \Filament\Schemas\Components\Section::make()
36+
return Section::make()
3537
->columns(1)
3638
->label('Seo')
3739
->schema([
38-
\Filament\Schemas\Components\Group::make([
40+
Group::make([
3941
TextEntry::make('Seo')
4042
->hiddenLabel()
4143
->state('Seo')
4244
->extraAttributes(['class' => 'text-2xl font-bold']),
4345
...$fields->toArray(),
4446
])
45-
->afterStateHydrated(function (\Filament\Schemas\Components\Group $component, ?Model $record) use ($locale): void {
47+
->afterStateHydrated(function (Group $component, ?Model $record) use ($locale): void {
4648
$component->getChildSchema()->fill($record?->fillSeoFieldState($locale));
4749
})
4850
->statePath('seoFields'),

src/Http/Middleware/SeoMiddleware.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Closure;
66
use Illuminate\Database\Eloquent\Model;
7+
use Illuminate\Http\Request;
78
use Illuminate\Support\Str;
89
use Wotz\Seo\Models\SeoRoute;
910
use Wotz\Seo\SeoRoutes;
@@ -13,7 +14,7 @@ class SeoMiddleware
1314
/**
1415
* Handle an incoming request.
1516
*
16-
* @param \Illuminate\Http\Request $request
17+
* @param Request $request
1718
* @return mixed
1819
*/
1920
public function handle($request, Closure $next)

src/Models/Traits/HasSeoFields.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Wotz\Seo\Models\Traits;
44

55
use Illuminate\Database\Eloquent\Model;
6+
use Illuminate\Database\Eloquent\Relations\MorphMany;
67
use Wotz\Seo\Facades\SeoBuilder;
78
use Wotz\Seo\Models\SeoField;
89
use Wotz\Seo\SeoTags;
@@ -22,7 +23,7 @@ abstract public function getSeoTags(): SeoTags;
2223
/**
2324
* Set the polymorphic relation.
2425
*
25-
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
26+
* @return MorphMany
2627
*/
2728
public function seoFields()
2829
{

0 commit comments

Comments
 (0)