Skip to content

Commit c73143e

Browse files
vladosclaude
andcommitted
Add Laravel 12 and PHP 8.4 support
- Added support for Laravel 12, 11 - Added support for PHP 8.4 - Updated to Pest v3 for testing - Upgraded testing dependencies (PHPUnit v11, Orchestra Testbench v9) - Migrated from nunomaduro/larastan to larastan/larastan - Updated Faker API usage in tests to use fake() helper - Migrated PHPUnit XML configuration to latest schema Breaking Changes: - Dropped support for Laravel 8 and below - Requires PHP 8.1 or higher 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent e47c8fe commit c73143e

File tree

4 files changed

+55
-53
lines changed

4 files changed

+55
-53
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
All notable changes to `laravel-unique-urls` will be documented in this file.
44

5+
## v1.0.0 - 2025-10-01
6+
7+
### Added
8+
- Laravel 12 support
9+
- Laravel 11 support
10+
- PHP 8.4 support
11+
12+
### Changed
13+
- Updated to Pest v3 for testing
14+
- Updated minimum PHP version to 8.1
15+
- Upgraded testing dependencies (PHPUnit v11, Orchestra Testbench v9)
16+
- Migrated from nunomaduro/larastan to larastan/larastan
17+
- Updated Faker API usage in tests to use `fake()` helper
18+
19+
### Breaking Changes
20+
- Dropped support for Laravel 8 and below
21+
- Requires PHP 8.1 or higher
22+
523
## v.0.4.0 - 2022-09-08
624

725
### What's Changed

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@
1717
],
1818
"require": {
1919
"php": "^8.1",
20-
"illuminate/contracts": "^9.0|^10.0|^11.0",
20+
"illuminate/contracts": "^9.0|^10.0|^11.0|^12.0",
2121
"spatie/laravel-model-info": "^1.4|^2.0",
2222
"spatie/laravel-package-tools": "^1.9.2|^2.0",
2323
"spatie/laravel-translatable": "^6.0|^7.0"
2424
},
2525
"require-dev": {
2626
"friendsofphp/php-cs-fixer": "^3.8",
27-
"nunomaduro/collision": "^6.0",
28-
"nunomaduro/larastan": "^2.0.1",
27+
"larastan/larastan": "^2.0|^3.0",
28+
"nunomaduro/collision": "^6.0|^7.0|^8.0",
2929
"nunomaduro/phpinsights": "^2.4",
30-
"orchestra/testbench": "^7.0",
31-
"pestphp/pest": "^1.21",
32-
"pestphp/pest-plugin-faker": "^1.0",
33-
"pestphp/pest-plugin-laravel": "^1.1",
30+
"orchestra/testbench": "^7.0|^8.0|^9.0",
31+
"pestphp/pest": "^2.0|^3.0",
32+
"pestphp/pest-plugin-faker": "^2.0|^3.0",
33+
"pestphp/pest-plugin-laravel": "^2.0|^3.0",
3434
"phpstan/extension-installer": "^1.1",
35-
"phpstan/phpstan-deprecation-rules": "^1.0",
36-
"phpstan/phpstan-phpunit": "^1.0",
37-
"phpunit/phpunit": "^9.5",
35+
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
36+
"phpstan/phpstan-phpunit": "^1.0|^2.0",
37+
"phpunit/phpunit": "^10.0|^11.0",
3838
"spatie/laravel-ray": "^1.26"
3939
},
4040
"autoload": {

phpunit.xml.dist

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
bootstrap="vendor/autoload.php"
8-
colors="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
12-
processIsolation="false"
13-
stopOnFailure="false"
14-
executionOrder="random"
15-
failOnWarning="true"
16-
failOnRisky="true"
17-
failOnEmptyTestSuite="true"
18-
beStrictAboutOutputDuringTests="true"
19-
verbose="true"
20-
>
21-
<testsuites>
22-
<testsuite name="Vlados Test Suite">
23-
<directory>tests</directory>
24-
</testsuite>
25-
</testsuites>
26-
<coverage>
27-
<include>
28-
<directory suffix=".php">./src</directory>
29-
</include>
30-
<report>
31-
<html outputDirectory="build/coverage"/>
32-
<text outputFile="build/coverage.txt"/>
33-
<clover outputFile="build/logs/clover.xml"/>
34-
</report>
35-
</coverage>
36-
<logging>
37-
<junit outputFile="build/report.junit.xml"/>
38-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/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">
3+
<testsuites>
4+
<testsuite name="Vlados Test Suite">
5+
<directory>tests</directory>
6+
</testsuite>
7+
</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>
18+
<source>
19+
<include>
20+
<directory suffix=".php">./src</directory>
21+
</include>
22+
</source>
3923
</phpunit>

tests/HasUniqueUrlsTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
for ($i = 0; $i < $generate; $i++) {
5252
$model = new TestModel();
5353
$model->disableGeneratingUrlsOnCreate();
54-
$model->name = \Pest\Faker\faker()->text(20) . time();
54+
$model->name = fake()->text(20) . time();
5555
$model->save();
5656
expect($model->urls)->toBeEmpty();
5757
}
@@ -67,15 +67,15 @@
6767
for ($i = 0; $i < $generate; $i++) {
6868
$translations = [];
6969
foreach (config('unique-urls.languages') as $locale => $lang) {
70-
$translations[$lang] = \Pest\Faker\faker($locale)->company() . $i;
70+
$translations[$lang] = fake($locale)->company() . $i;
7171
}
7272
$parentModel = TestModel::create([
7373
'name' => $translations,
7474
]);
7575
for ($b = 0; $b < $generate; $b++) {
7676
$translations = [];
7777
foreach (config('unique-urls.languages') as $locale => $lang) {
78-
$translations[$lang] = \Pest\Faker\faker($locale)->company() . $b;
78+
$translations[$lang] = fake($locale)->company() . $b;
7979
}
8080
$childModel = ChildModel::create([
8181
'parent_id' => $parentModel->id,
@@ -96,7 +96,7 @@
9696
test('6. Check if urls deleted after model deleted', function () {
9797
$model = TestModel::create(['name' => 'this is a test']);
9898
expect($model->absolute_url)->toEqual(url(app()->getLocale() . '/parent/this-is-a-test'));
99-
$newName = \Pest\Faker\faker()->text;
99+
$newName = fake()->text;
100100
$model->name = $newName;
101101
$model->save();
102102
expect($model->absolute_url)->toEqual(url(app()->getLocale() . '/parent/' . Str::slug($newName)));
@@ -112,7 +112,7 @@
112112
test('7. Check if url is updated correctly', function () {
113113
$model = TestModel::create(['name' => 'this is a test']);
114114
expect($model->absolute_url)->toEqual(url(app()->getLocale() . '/parent/this-is-a-test'));
115-
$newName = \Pest\Faker\faker()->text;
115+
$newName = fake()->text;
116116
$model->name = $newName;
117117
$model->save();
118118
expect($model->absolute_url)->toEqual(url(app()->getLocale() . '/parent/' . Str::slug($newName)));
@@ -121,7 +121,7 @@
121121
test('8. Check if urls are created when updating, if for some reason they are deleted', function () {
122122
$model = TestModel::create(['name' => 'this is a test']);
123123
$model->urls()->delete();
124-
$newName = \Pest\Faker\faker()->text;
124+
$newName = fake()->text;
125125
$model->name = $newName;
126126
$model->save();
127127
$model->load(['urls']);

0 commit comments

Comments
 (0)