Commit Graph
105 Commits
Author SHA1 Message Date
Jeramy Hing 472c1bad5d Feature: Add Config Option to Enforce Nullable Relationships (#1580)
* feat: add config option for nullable relationships

Introduce enforce_nullable_relationships configuration to control nullable Eloquent relationships.

* refactor: update logic for nullable relationships

Update isRelationNullable method to respect new config option.

* test: add tests for nullable relationship config

- Verify behavior of enforce_nullable_relationships configuration option.
- Create snapshot to reflect enforce_nullable_relationships set to false.

* docs: improve documented context and usage

* docs: update CHANGELOG with enforce_nullable_relationships option
2024-10-30 22:35:58 +01:00
barryvdh 90e7c5ac47 Update CHANGELOG 2024-10-29 14:05:10 +00:00
Barry vd. Heuvel be806dc316 Update CHANGELOG.md 2024-10-28 15:11:38 +01:00
Ramon DantasandBarry vd. Heuvel 800e2347a6 feat: use numeric type on fields with decimal casts (#1583)
* feat: use `numeric` type on fields with `decimal` casts

* docs: update CHANGELOG.md

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
2024-10-28 12:32:31 +01:00
Barry vd. Heuvel 7549f58a30 Smarter reset (#1603)
* Smarter reset

* Changelog

* Fix phpdocs
2024-10-28 12:21:53 +01:00
Barry vd. Heuvel d6fb7907cc Merge branch 'patch-1' of github.com:uno-sw/laravel-ide-helper into uno-sw-patch-1 2024-10-28 11:35:50 +01:00
Pieter Willekensandlaravel-ide-helper dc70337e48 feat(pivot): add support for multiple pivot types when using the same accessor (#1597)
* feat(pivot): add support for multiple pivot types when using the same accessor

* composer fix-style

* changelog

* resolve namespaces

* Revert "resolve namespaces"

This reverts commit 37559ab089.

* resolve namespaces

---------

Co-authored-by: laravel-ide-helper <[email protected]>
2024-10-28 11:32:19 +01:00
KentarouTakeda 085ca3e225 Compatible with Generics Eloquent Builder in Laravel 11.15 (#1591)
* feat: support generics eloquent builder

* fix: required laravel version

* fix: ci execution is only for Laravel-11

* docs: add CHANGELOG

* docs: update supported Laravel versions and adjust output examples
2024-10-17 18:37:19 +02:00
khaled sadek 643329d23d Fix type of hased model property (#1579)
* set hashed properity as string

* add to changelog

* add test
2024-08-07 09:29:14 +02:00
uno-sw 07719015b3 Update CHANGELOG.md 2024-08-02 13:28:07 +09:00
Barry vd. Heuvel 591e7d665f Update CHANGELOG.md (#1570) 2024-07-12 16:20:51 +02:00
f5759e2001 Add static to isBuiltin() check in ide-helper:models (#1541)
* Add `\\static` as check

For some reason, the `static` keyword as a return type, does not return `isBuiltin()` === true, so a `\\` is added. We need to manually add it to the built in check.

* Update ModelsCommand.php

* Add tests

* Add CHANGELOG.md entry

---------

Co-authored-by: Markus Podar <[email protected]>
Co-authored-by: Barry vd. Heuvel <[email protected]>
2024-07-12 16:08:08 +02:00
michalandBarry vd. Heuvel f7a3dc8ff2 Add support in morphTo relationship for null values (1547) (#1549)
Co-authored-by: Barry vd. Heuvel <[email protected]>
2024-07-12 16:06:56 +02:00
Braunson YagerandBarry vd. Heuvel 672acce5ae feat: add support for AsEnumCollection casts (#1557)
* Adding support for casting to AsEnumCollection

* Adding missing string to advanced_casts table for enum_collection

* Added to snapshots and ArrayCastsWithComment

* Update CHANGELOG.md

* Reverted automated whitespace, strict changes

* Updated test snapshots, tests passing

* Whitespace revert

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
2024-07-12 16:03:57 +02:00
Barry vd. Heuvel a1573919c1 Update CHANGELOG.md 2024-07-12 15:56:03 +02:00
c6509b658f Improved attribute handling with types and Attribute support (#1567)
* Add `AllowDynamicProperties` Attribute to cooperate with php8.2 deprecation

* lint snapshot

* Fix collection attribute typing

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update composer.json

* Fix collectino with template types WIP

* Add `AllowDynamicProperties` Attribute to cooperate with php8.2 deprecation

* Fix collection attribute typing

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update composer.json

* composer fix-style

* Fix tests

* Fix tests

* composer fix-style

* Fix collectino with complex template types{

* Delete phpactor

* Install from scrumble repo

* Implemented correct attribute handling

* composer fix-style

* Revert "Install from scrumble repo"

This reverts commit 3f1057adb6.

* Re-add barryvdh links

* Revert "Update composer.json"

This reverts commit 98252fe740.

* Fix pivot test

* Correct CHANGELOG.md with attribute merge request

* More clear PhpDocTypeParser filename and clarified directory according to PSR12

---------

Co-authored-by: GeoSot <[email protected]>
Co-authored-by: laravel-ide-helper <[email protected]>
Co-authored-by: Luukdewaaier <[email protected]>
Co-authored-by: Luuk de Weijer <[email protected]>
2024-07-12 15:53:04 +02:00
sforward 6338abb2d7 Fix return value of scopes from parent class (#1366) 2024-04-01 08:43:59 +02:00
dev2a ac7e186270 Add pivot class property (#1518)
* Add pivot class property

* Add test for pivot class properties

* Fix failed test for pivot class properties

* Update CHANGELOG.md

* Fix failed test
2024-03-11 14:37:15 +01:00
Barry vd. Heuvel bc1d67f01c Prepare 3.0 release (#1530)
* Prepare 3.0 release

* Update CHANGELOG.md

* Update CHANGELOG.md
2024-03-01 13:53:18 +01:00
Markus PodarandBarry vd. Heuvel 49ac75d805 Remove --smart-reset completely (#1525)
* Remove `--smart-reset` completely

See https://github.com/barryvdh/laravel-ide-helper/pull/1523#issuecomment-1952313183

* Update CHANGELOG.md

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
2024-02-19 14:03:16 +01:00
Barry vd. Heuvel 02af2a278a Merge reset/smart reset, don't set class (#1523)
* Merge reset/smart reset, don't set class

* Add changelog
2024-02-19 12:59:22 +01:00
Barry vd. Heuvel d7ed749f3e Use int/bool instead of longer variant (#1524)
* Use int/bool instead of longer variant

* Add changelog

* Update snapshots
2024-02-19 12:39:07 +01:00
Markus Podar 9af62e243d Bump minimum PHP version to 8.1 & misc maintenance (#1521)
* Bump minimum PHP version to 8.1

Laravel 10 doesn't support 8.0 anyway

* Remove phpunit 9

* gha: remove unused matrix dimension

* gha: bump runner os

* tests: remove outdated version checks
2024-02-17 22:08:15 +01:00
05259b695d Add support for Laravel 11 (#1520)
* update dependencies

* Implement new methods for `Authenticatable` contract

* Added Laravel 11 to CI test target

* normalize composer.json

* Remove obsolete migration method (column type) from test

* Update snapshots

* Add changelog entry

* Update readme

---------

Co-authored-by: 武田 憲太郎 <[email protected]>
Co-authored-by: barryvdh <[email protected]>
2024-02-17 11:32:56 +01:00
Barry vd. Heuvel 8bfe918f65 Update CHANGELOG.md 2024-02-17 11:27:21 +01:00
Barry vd. Heuvel 77831852bb Fix final class keyword (#1517)
* Fix final class keyword

* Add changelog
2024-02-15 15:23:20 +01:00
Barry vd. HeuvelandMarkus Podar dca3ebe81e Prepare 2.15 release (#1514)
* Prepare 2.15 release

* Prepare 2.15 release

* Add missing CHANGELOG.md entries

---------

Co-authored-by: Markus Podar <[email protected]>
2024-02-14 12:19:26 +01:00
341c0ab89f feat: add support for AsCollection and AsArrayObject casts (#1393)
* feat: add support for AsCollection and AsArrayObject casts

* update changelog

* improve tests

* remove change

* composer fix-style

* snapshot

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
Co-authored-by: laravel-ide-helper <[email protected]>
2024-02-08 10:59:02 +01:00
f12d933ab1 Add support for non type-hinted attribute accessors with no backed property (#1411)
* Read Attribute type from parameter

* Update CHANGELOG.md

* Update ModelsCommand.php

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
Co-authored-by: Barry vd. Heuvel <[email protected]>
2024-02-08 09:39:10 +01:00
Caleb White 6115100a0f Add support for composite keys (#1479)
* Add support for composite keys

* chore: add composite foreign key test
2024-02-08 07:42:27 +01:00
409bbf665b Fix unsetMethod in ModelsCommand (#1453)
* Fix unsetMethod in ModelsCommand

* composer fix-style

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
Co-authored-by: laravel-ide-helper <[email protected]>
2024-02-07 21:48:09 +01:00
Barry vd. Heuvel 872b470d9b Update CHANGELOG.md 2024-02-07 21:37:51 +01:00
Filip Iulian Pacurar 04c1a8d444 Support generating helper files for real-time facades (#1455)
* Support generating helper files for real-time facades

Add changelog entry for real-time facades support

Mention real-time facades support in readme

Fix code style

Import

* Remove useless assertions

We cannot 100% control the output file has only the real-time facades, anything else can be in the final output
2024-02-07 21:35:02 +01:00
f64ff9c0b1 Add support for enum default arguments using enum cases (#1464)
* add case when default value is of type enum

* Update CHANGELOG.md

* add tests for enum arguments default values

* ignore psalm issue (built-in `\UnitEnum` class does not exists in PHP7)

* Update run-static-analysis.yml to use PHP8.1

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
Co-authored-by: Barry vd. Heuvel <[email protected]>
2024-02-07 21:27:30 +01:00
Markus Podar a8b34ad228 Removed support for Laravel 8 and therefore for PHP < 8.0 (#1504)
* Removed support for Laravel 8 and therefore for PHP < 8.0

* Update php-cs-fixer to v3

* composer fix-style
2024-02-05 13:25:08 +01:00
Barry vd. Heuvel 485c756f6c Prepare 2.14.0 release 2024-02-05 09:16:36 +01:00
Markus Podar cf4687f98c Prepare 2.14.0 release (#1503) 2024-02-05 09:13:57 +01:00
Markus Podar 726e595578 Add support for nikic/php-parser:^5 and (hopefully) doctrine/dbal:^4 (#1502)
* Add support for nikic/php-parser:^5

- `createForHostVersion` has been added to php-parse 4.18 so code can
  run with both versions [1]
- therefore also bumped the minimum required version to it

Note:
The dev dependency vimeo/psalm is **not** compatible with
php-parser:^5 currently. This does not impact usages of this library,
but sometimes cause friction when working on this library.
For our CI this isn't a problem, because we already remove that
dependency before running the test suite.

[1] https://github.com/nikic/PHP-Parser/blob/master/UPGRADE-5.0.md#changes-to-the-parser-factory

* gha: prevent cancelling of all jobs if one fails

* Update CHANGELOG.md

* gha: remove unsupported Laravel / PHP combinations

According to https://laravel.com/docs/10.x/releases

* Add dbal:^4 too
2024-01-28 19:33:31 +01:00
Markus PodarandBarry vd. Heuvel 4dc20b028a Remove offical support for Lumen (#1425)
I'm proposing to drop official suport for Lumen for the following reasons:
- Lumen itself is dead, per [1]
  > **Note:** In the years since releasing Lumen, PHP has made a variety of wonderful performance improvements. For this reason, along with the availability of [Laravel Octane](https://laravel.com/docs/octane), we no longer recommend that you begin new projects with Lumen. Instead, we recommend always beginning new projects with [Laravel](https://laravel.com).

  Laravel Octact is just Laravel and no one using ide-helper with it
  needs anything special.
- For now, the change is mostly on the logistics side (readme, run tests,
  issues). In the past we had some special code but over time this was
  already removed.
  For now people still can use it and nothing will break out of the blue,
  but eventually it might

There are a only a few Lumen related issues open currently which would
be closed by this (#1105, #1069, #438).

[1] https://github.com/laravel/lumen/commit/69b26578d2f15595ea901278434b74df459c4329

Co-authored-by: Barry vd. Heuvel <[email protected]>
2023-02-20 13:23:52 +01:00
39885645b9 Add support for protected Attribute accessors (#1339)
* Add support for protected Attribute accessors

* Fix formatting

* Prevent accessors methods marked as private from being added

* Exclude specific accessors based on trait instead of class

* Add changelog entry

* Add clarifying comment

* Fix accessor attributes not working on PHP < 8.1

* Reintroduce method variable to reduce PR clutter

* Change variable name to reduce PR clutter

* Update CHANGELOG.md

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
Co-authored-by: Barry vd. Heuvel <[email protected]>
2023-02-20 09:44:01 +01:00
Barry vd. Heuvel aa1aa66ee6 Update CHANGELOG.md 2023-02-20 09:40:08 +01:00
b70a9f5048 add immutable_date/time:* casts (#1380)
* add immutable_date/time:* casts

* fix style

* Update CHANGELOG.md

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
Co-authored-by: Barry vd. Heuvel <[email protected]>
2023-02-20 09:36:24 +01:00
Markus Podar 97fd0e0a2d Update changelog after new release 2.13.0 (#1418) 2023-02-04 22:04:42 +01:00
Bartlomiej Kwarcinski 81d5b223ff Fix Castables issue #1312 (#1388)
* Return Castable class if failed to detect it from return types

* fix-style

* Add CHANGELOG.md entry
2023-02-04 14:56:40 +01:00
Alies LapatsinandBarry vd. Heuvel ce24d4b013 Added support for Laravel 10 (+ update testing matrix) (#1407)
* Laravel 10 support

* Add events v10 to suggestions

* Exclude invalid combinations from testing matrix, test on PHP 8.2

* Update CHANGELOG.md

* Use laravel/laravel dev-master as 10.x version

* Exclude one more laravel-php combination

* Use 10.* instead if dev-master

* Update run-integration-tests.yml

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
2023-02-04 14:54:33 +01:00
Taner KucukyurukandMarkus Podar f0e4cf5e78 Generics annotations support (#1298)
* option to use generics syntax, default to yes in laravel 9

* rename `use_generics_syntax` to `use_generics_annotations`

* update readme and changelog

* remove laravel 9 default override

* include key type in generics annotations

* readme rewording

* set `use_generics_annotations` to `true` by default

* update tests to reflect `use_generics_annotations` being set to `true` by default

* default `use_generics_annotations` setting to true when not set in config

Co-authored-by: Markus Podar <[email protected]>

---------

Co-authored-by: Markus Podar <[email protected]>
2023-01-28 16:48:05 +01:00
Bentley O'Kane-Chase f055d42b39 Add phpstorm metadata for mock methods when testing (#1405)
* Add phpstorm metadata for testing

* Update CHANGELOG.md
2023-01-17 12:37:15 +01:00
sforwardandSimon Verwaard dda200fd34 Add support for CastsInboundAttributes (#1329)
* Add support for CastsInboundAttributes

* Update changelog

Co-authored-by: Simon Verwaard <[email protected]>
2022-09-13 10:42:06 +02:00
JefemyandBarry vd. Heuvel c8f0f914e3 Fix issue where \Eloquent is not included when using write_mixin (#1352)
* Check for exact mixin name when writing

* changelog

* add mixin to test class

Co-authored-by: Barry vd. Heuvel <[email protected]>
2022-08-11 12:39:26 +02:00
KentarouTakeda 07f5eaea73 Fix return type of methods provided by SoftDeletes (#1345)
* Fix return type of methods provided by `SoftDeletes`

* Update CHANGELOG

* fix test / update snapshot
2022-08-11 12:36:43 +02:00