Skip to content

Commit 90b00f1

Browse files
authored
Merge pull request #65 from bumpcore/64-1x-laravel-11-support
Laravel 11 support
2 parents f45e367 + 14227f5 commit 90b00f1

File tree

9 files changed

+89
-73
lines changed

9 files changed

+89
-73
lines changed

.github/workflows/tests.yml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
name: "Tests"
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
- '*.x'
8-
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- '*.x'
8+
pull_request:
99

1010
jobs:
11-
run:
12-
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
php-versions: ["8.1", "8.2"]
16-
steps:
17-
- name: Setup PHP
18-
uses: shivammathur/setup-php@v2
19-
with:
20-
php-version: ${{ matrix.php-versions }}
11+
run:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php: [8.1, 8.2, 8.3]
16+
laravel: [10, 11]
17+
exclude:
18+
- php: '8.1'
19+
laravel: 11
2120

22-
- name: Checkout code
23-
uses: actions/checkout@v3
21+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
2422

25-
- name: Install dependencies
26-
run: composer install --prefer-dist --no-progress --no-interaction
23+
steps:
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
2728

28-
- name: Execute tests
29-
run: ./vendor/bin/pest
29+
- name: Checkout code
30+
uses: actions/checkout@v3
31+
32+
- name: Install dependencies
33+
run: |
34+
composer require "illuminate/support=^${{ matrix.laravel }}" --no-update
35+
composer update --prefer-dist --no-interaction --no-progress
36+
37+
- name: Execute tests
38+
run: ./vendor/bin/pest

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Editor.php is a package designed to assist in parsing and manipulating the outpu
66

77
## Table Of Contents
88

9+
* [Version Table](#version-table)
910
* [Quick Start](#quick-start)
1011
* [EditorPhp](#editorphp)
1112
+ [Creating Instance](#creating-instance)
@@ -32,6 +33,12 @@ Editor.php is a package designed to assist in parsing and manipulating the outpu
3233
+ [Publishing Views and Configuration](#publishing-views-and-configuration)
3334
+ [Commands](#commands)
3435
* [Contribution](#contribution)
36+
37+
# Version Table
38+
| Editor.php | Laravel | PHP |
39+
| --- | --- | --- |
40+
| 1.x | 10.x ~ 11.x | 8.1 ~ 8.3 |
41+
3542
# Quick Start
3643

3744
Install package by:

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
],
2323
"require": {
2424
"php": "^8.1",
25-
"illuminate/support": "^10.0",
26-
"illuminate/validation": "^10.0",
25+
"illuminate/support": "^10.0|^11.0",
26+
"illuminate/validation": "^10.0|^11.0",
2727
"fakerphp/faker": "^1.21"
2828
},
2929
"extra": {
@@ -34,8 +34,8 @@
3434
}
3535
},
3636
"require-dev": {
37-
"pestphp/pest": "^1.22.4",
38-
"orchestra/testbench": "^8.0",
37+
"pestphp/pest": "^1.22.4|^2.0",
38+
"orchestra/testbench": "^8.0|^9.0",
3939
"friendsofphp/php-cs-fixer": "^3.14.4",
4040
"phpstan/phpstan": "^1.10"
4141
},

config/editor.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
return [
44
'blocks' => [
5-
'attaches' => \BumpCore\EditorPhp\Blocks\Attaches::class,
6-
'checklist' => \BumpCore\EditorPhp\Blocks\Checklist::class,
7-
'code' => \BumpCore\EditorPhp\Blocks\Code::class,
8-
'delimiter' => \BumpCore\EditorPhp\Blocks\Delimiter::class,
9-
'embed' => \BumpCore\EditorPhp\Blocks\Embed::class,
10-
'header' => \BumpCore\EditorPhp\Blocks\Header::class,
11-
'image' => \BumpCore\EditorPhp\Blocks\Image::class,
12-
'linkTool' => \BumpCore\EditorPhp\Blocks\LinkTool::class,
13-
'list' => \BumpCore\EditorPhp\Blocks\ListBlock::class,
14-
'paragraph' => \BumpCore\EditorPhp\Blocks\Paragraph::class,
15-
'personality' => \BumpCore\EditorPhp\Blocks\Personality::class,
16-
'quote' => \BumpCore\EditorPhp\Blocks\Quote::class,
17-
'raw' => \BumpCore\EditorPhp\Blocks\Raw::class,
18-
'table' => \BumpCore\EditorPhp\Blocks\Table::class,
19-
'warning' => \BumpCore\EditorPhp\Blocks\Warning::class,
5+
'attaches' => BumpCore\EditorPhp\Blocks\Attaches::class,
6+
'checklist' => BumpCore\EditorPhp\Blocks\Checklist::class,
7+
'code' => BumpCore\EditorPhp\Blocks\Code::class,
8+
'delimiter' => BumpCore\EditorPhp\Blocks\Delimiter::class,
9+
'embed' => BumpCore\EditorPhp\Blocks\Embed::class,
10+
'header' => BumpCore\EditorPhp\Blocks\Header::class,
11+
'image' => BumpCore\EditorPhp\Blocks\Image::class,
12+
'linkTool' => BumpCore\EditorPhp\Blocks\LinkTool::class,
13+
'list' => BumpCore\EditorPhp\Blocks\ListBlock::class,
14+
'paragraph' => BumpCore\EditorPhp\Blocks\Paragraph::class,
15+
'personality' => BumpCore\EditorPhp\Blocks\Personality::class,
16+
'quote' => BumpCore\EditorPhp\Blocks\Quote::class,
17+
'raw' => BumpCore\EditorPhp\Blocks\Raw::class,
18+
'table' => BumpCore\EditorPhp\Blocks\Table::class,
19+
'warning' => BumpCore\EditorPhp\Blocks\Warning::class,
2020
],
2121
];

src/Blocks/Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function render(): string
6565
public static function fake(\Faker\Generator $faker): array
6666
{
6767
return [
68-
'file' => ['url' => $faker->imageUrl()],
68+
'file' => ['url' => 'https://picsum.photos/200/300'],
6969
'caption' => $faker->text(),
7070
'withBorder' => $faker->boolean(),
7171
'stretched' => $faker->boolean(),

src/Blocks/LinkTool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function fake(\Faker\Generator $faker): array
7373
'title' => $faker->text(32),
7474
'site_name' => $faker->text(32),
7575
'description' => $faker->text(96),
76-
'image' => ['url' => $faker->imageUrl()],
76+
'image' => ['url' => 'https://picsum.photos/200/300'],
7777
],
7878
];
7979
}

src/Blocks/Personality.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static function fake(\Faker\Generator $faker): array
6969
'name' => $faker->name(),
7070
'description' => $faker->text(),
7171
'link' => $faker->url(),
72-
'photo' => $faker->imageUrl(),
72+
'photo' => 'https://picsum.photos/200/300',
7373
];
7474
}
7575
}

src/Parser.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ class Parser
1717
* @var array<string, string>
1818
*/
1919
public static array $blocks = [
20-
'attaches' => \BumpCore\EditorPhp\Blocks\Attaches::class,
21-
'checklist' => \BumpCore\EditorPhp\Blocks\Checklist::class,
22-
'code' => \BumpCore\EditorPhp\Blocks\Code::class,
23-
'delimiter' => \BumpCore\EditorPhp\Blocks\Delimiter::class,
24-
'embed' => \BumpCore\EditorPhp\Blocks\Embed::class,
25-
'header' => \BumpCore\EditorPhp\Blocks\Header::class,
26-
'image' => \BumpCore\EditorPhp\Blocks\Image::class,
27-
'linkTool' => \BumpCore\EditorPhp\Blocks\LinkTool::class,
28-
'list' => \BumpCore\EditorPhp\Blocks\ListBlock::class,
29-
'paragraph' => \BumpCore\EditorPhp\Blocks\Paragraph::class,
30-
'personality' => \BumpCore\EditorPhp\Blocks\Personality::class,
31-
'quote' => \BumpCore\EditorPhp\Blocks\Quote::class,
32-
'raw' => \BumpCore\EditorPhp\Blocks\Raw::class,
33-
'table' => \BumpCore\EditorPhp\Blocks\Table::class,
34-
'warning' => \BumpCore\EditorPhp\Blocks\Warning::class,
20+
'attaches' => Blocks\Attaches::class,
21+
'checklist' => Blocks\Checklist::class,
22+
'code' => Blocks\Code::class,
23+
'delimiter' => Blocks\Delimiter::class,
24+
'embed' => Blocks\Embed::class,
25+
'header' => Blocks\Header::class,
26+
'image' => Blocks\Image::class,
27+
'linkTool' => Blocks\LinkTool::class,
28+
'list' => Blocks\ListBlock::class,
29+
'paragraph' => Blocks\Paragraph::class,
30+
'personality' => Blocks\Personality::class,
31+
'quote' => Blocks\Quote::class,
32+
'raw' => Blocks\Raw::class,
33+
'table' => Blocks\Table::class,
34+
'warning' => Blocks\Warning::class,
3535
];
3636

3737
/**

tests/Pest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
uses()
66
->beforeEach(function() {
77
EditorPhp::register([
8-
'attaches' => \BumpCore\EditorPhp\Blocks\Attaches::class,
9-
'checklist' => \BumpCore\EditorPhp\Blocks\Checklist::class,
10-
'code' => \BumpCore\EditorPhp\Blocks\Code::class,
11-
'delimiter' => \BumpCore\EditorPhp\Blocks\Delimiter::class,
12-
'embed' => \BumpCore\EditorPhp\Blocks\Embed::class,
13-
'header' => \BumpCore\EditorPhp\Blocks\Header::class,
14-
'image' => \BumpCore\EditorPhp\Blocks\Image::class,
15-
'linkTool' => \BumpCore\EditorPhp\Blocks\LinkTool::class,
16-
'list' => \BumpCore\EditorPhp\Blocks\ListBlock::class,
17-
'paragraph' => \BumpCore\EditorPhp\Blocks\Paragraph::class,
18-
'personality' => \BumpCore\EditorPhp\Blocks\Personality::class,
19-
'quote' => \BumpCore\EditorPhp\Blocks\Quote::class,
20-
'raw' => \BumpCore\EditorPhp\Blocks\Raw::class,
21-
'table' => \BumpCore\EditorPhp\Blocks\Table::class,
22-
'warning' => \BumpCore\EditorPhp\Blocks\Warning::class,
8+
'attaches' => BumpCore\EditorPhp\Blocks\Attaches::class,
9+
'checklist' => BumpCore\EditorPhp\Blocks\Checklist::class,
10+
'code' => BumpCore\EditorPhp\Blocks\Code::class,
11+
'delimiter' => BumpCore\EditorPhp\Blocks\Delimiter::class,
12+
'embed' => BumpCore\EditorPhp\Blocks\Embed::class,
13+
'header' => BumpCore\EditorPhp\Blocks\Header::class,
14+
'image' => BumpCore\EditorPhp\Blocks\Image::class,
15+
'linkTool' => BumpCore\EditorPhp\Blocks\LinkTool::class,
16+
'list' => BumpCore\EditorPhp\Blocks\ListBlock::class,
17+
'paragraph' => BumpCore\EditorPhp\Blocks\Paragraph::class,
18+
'personality' => BumpCore\EditorPhp\Blocks\Personality::class,
19+
'quote' => BumpCore\EditorPhp\Blocks\Quote::class,
20+
'raw' => BumpCore\EditorPhp\Blocks\Raw::class,
21+
'table' => BumpCore\EditorPhp\Blocks\Table::class,
22+
'warning' => BumpCore\EditorPhp\Blocks\Warning::class,
2323
]);
2424
})->in('.');

0 commit comments

Comments
 (0)