Skip to content

Commit d497307

Browse files
authored
[2.x] Supports Laravel 11 & PHP 8.2+ (#20)
1 parent dd8ddc6 commit d497307

15 files changed

+4161
-3109
lines changed

.github/workflows/build_laravel.yaml

+3-41
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php: [8.1, 8.2]
18-
laravel: [ '^9', '^10' ]
17+
php: [8.2, 8.3]
18+
laravel: [ '^11' ]
1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121
if: success()
2222

2323
- name: Setup PHP with coverage driver
@@ -26,44 +26,6 @@ jobs:
2626
php-version: ${{ matrix.php }}
2727
coverage: pcov
2828

29-
- name: Set Minimum PHP 8.1 Versions
30-
uses: nick-fields/retry@v2
31-
with:
32-
timeout_minutes: 5
33-
max_attempts: 5
34-
command: composer require symfony/css-selector:^6.0 --no-interaction --no-update
35-
36-
- name: Set Minimum PHP 8.2 Versions
37-
uses: nick-fields/retry@v2
38-
with:
39-
timeout_minutes: 5
40-
max_attempts: 5
41-
command: composer require guzzlehttp/guzzle:^7.5 guzzlehttp/psr7:^2.4 predis/predis:^2.0.2 --no-interaction --no-update
42-
if: matrix.php >= 8.2
43-
44-
- name: Set Laravel Version
45-
uses: nick-fields/retry@v2
46-
with:
47-
timeout_minutes: 5
48-
max_attempts: 5
49-
command: composer require laravel/framework:${{ matrix.laravel }} --no-interaction --no-update
50-
51-
- name: Set Testbench Version for Laravel ^9
52-
uses: nick-fields/retry@v2
53-
with:
54-
timeout_minutes: 5
55-
max_attempts: 5
56-
command: composer require orchestra/testbench:^7 --dev --no-interaction --no-update
57-
if: matrix.laravel == '^9'
58-
59-
- name: Set Testbench Version for Laravel ^10
60-
uses: nick-fields/retry@v2
61-
with:
62-
timeout_minutes: 5
63-
max_attempts: 5
64-
command: composer require orchestra/testbench:^8 --dev --no-interaction --no-update
65-
if: matrix.laravel == '^10'
66-
6729
- name: Install dependencies
6830
uses: nick-fields/retry@v2
6931
with:

.github/workflows/build_mysql.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and test [MYSQL]
1+
name: Build and test [MYSQL 8.0]
22
on:
33
pull_request:
44
branches:
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
if: success()
1818

1919
- name: Setup PHP with coverage driver
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: '8.1'
22+
php-version: '8.2'
2323
coverage: pcov
2424

2525
- name: Setup
@@ -38,7 +38,7 @@ jobs:
3838
composer test-coverage
3939
4040
- name: upload coverage to codecov.io
41-
uses: codecov/codecov-action@v1
41+
uses: codecov/codecov-action@v3
4242
with:
4343
token: ${{ secrets.CODECOV_TOKEN }}
4444
file: ./coverage.xml

.github/workflows/build_postgresql.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and test [PostgreSQL]
1+
name: Build and test [PostgreSQL 15.x]
22
on:
33
pull_request:
44
branches:
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
services:
1515
postgresql:
16-
image: postgres:14
16+
image: postgres:15
1717
env:
1818
POSTGRES_DB: eloquentdocs
1919
POSTGRES_USER: root
@@ -23,13 +23,13 @@ jobs:
2323
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
2424

2525
steps:
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v3
2727
if: success()
2828

2929
- name: Setup PHP with coverage driver
3030
uses: shivammathur/setup-php@v2
3131
with:
32-
php-version: '8.1'
32+
php-version: '8.3'
3333
extensions: pdo, pdo_pgsql
3434
coverage: none
3535

.github/workflows/build_sqlite.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
if: success()
1818

1919
- name: Setup PHP with coverage driver
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: '8.1'
22+
php-version: '8.3'
2323
coverage: pcov
2424

2525
- name: Setup

README.md

+24-9
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ And, welcome to Eloquent phpDoc Generator, which going to help you to achieve th
2020

2121
## What will Eloquent phpDoc Generator will generate?
2222
- Table name
23-
- Table columns (with types)
23+
- Table columns (with correct types - including Casting types 😎)
2424
- Model relationships
2525
- Model attributes/accessors
2626

2727
## Available For / Requirements
28-
- PHP 8.1 / 8.2
29-
- Laravel 9 / 10
28+
29+
- **v2.x**: Laravel 11, PHP 8.2+.
30+
- **v1.x**: Laravel 9/10, PHP 8.0, 8.1.
3031

3132
## Install
3233
Install as dev-dependencies is enough, since you are only going to use this command on `local/development` env.
@@ -87,15 +88,12 @@ Thank you for using EloquentDocs!
8788

8889
</details>
8990

90-
Note: if you haven't installed `doctrine/dbal` as your dev-dependency,
91-
then once you trigger the command for the first time, it will help you to install the needful dependency
92-
9391
## Best practices
94-
- Use `$casts` in your model, in order to help EloquentPhpDoc generate better types for you (array, Carbon,...)
92+
- Use `$casts` in your model, in order to help EloquentPhpDoc generate better types for you (array, date, datetime,...)
9593
- For `get*Attribute` accessor, always declare the return type
9694

97-
Note: Eloquent new `Attribute` class utilize the data via Closure, thus we can't declare any return type for any attributes.
98-
For this case, EloquentPhpDoc will always return `mixed`
95+
Note: for Eloquent new `Attribute` class utilize the data via Closure, making it impossible to acquire the return types.
96+
For this case, EloquentDocs will always return `mixed`
9997

10098
## Release logs
10199
- v1.0.0
@@ -117,6 +115,11 @@ For this case, EloquentPhpDoc will always return `mixed`
117115
- New command to bulk generate from a given model path.
118116
- `php artisan eloquent:bulk-phpdoc "app/Models/*.php"`
119117
- Fixed an issue where accessors/attributes being generated as snake_case. Should be camelCase.
118+
- v2.0.0
119+
- Supports Laravel 11 + PHP 8.2/8.3
120+
- DBAL as required dependencies
121+
- Better date/datetime parsing (Carbon & Carbon immutable)
122+
- Better boolean parsing
120123

121124
## Contribute to the library
122125

@@ -132,3 +135,15 @@ MIT License
132135

133136
- [Seth Phat](https://github.com/sethsandaru)
134137
- And contributors
138+
139+
## (Sponsered Content) Introducing RenderPDF.io - Render your PDF in seconds
140+
141+
![RenderPDF.io](./.github/render-pdf-io.png)
142+
143+
[RenderPDF.io](https://renderpdf.io) is a Render-PDF-as-a-Service that provides developer-friendly APIs
144+
to render your HTML content to modern PDFs file sin seconds 😎.
145+
146+
All you have to do is get your API Key and send RenderPDF.io an API call 🚀, no infrastructure setup, no overhead and
147+
hassle-free integration 🔋.
148+
149+
Get your free API Key today: [Sign Up to RenderPDF.io](https://renderpdf.io)

composer.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
"name": "sethphat/eloquent-docs",
3-
"version": "1.2.3",
3+
"version": "2.0.0",
44
"description": "Generate PHPDoc scope for your Eloquent models",
55
"type": "library",
66
"require": {
7-
"php": "^8",
8-
"laravel/framework": "^10|^9"
7+
"php": "^8.2|^8.3",
8+
"laravel/framework": "^11",
9+
"doctrine/dbal": "^3.8"
910
},
1011
"require-dev": {
1112
"fakerphp/faker": "^1.20",
1213
"mockery/mockery": "^1.5",
13-
"phpunit/phpunit": "^9.5",
14-
"orchestra/testbench": "^7.6",
15-
"phpunit/php-code-coverage": "^9.2",
16-
"doctrine/dbal": "^3.4"
14+
"orchestra/testbench": "^9",
15+
"phpunit/phpunit": "^10",
16+
"phpunit/php-code-coverage": "^10"
1717
},
1818
"license": "MIT",
1919
"authors": [

0 commit comments

Comments
 (0)