Stephen Jason Wang
cc26683e8e
fix: strip redundant builder @param tags for optional scalar defaults ( #1785 )
2026-08-04 14:28:01 +02:00
Thomas Gnandt and Claude Opus 4.7
5060909c37
fix: Don't force |null on BelongsTo relations using ->withTrashed() ( #1783 )
...
When the related model uses SoftDeletes, `isRelationNullable()` was
forcing the BelongsTo relation type to nullable even if the relation
explicitly opted into trashed parents via `->withTrashed()`. Combined
with a NOT NULL FK column and DB-level FK constraint, the relation is
effectively non-nullable.
The SoftDeletes branch is now skipped when the relation has removed
the `SoftDeletingScope` and added no constraint on the qualified
`deleted_at` column. `->onlyTrashed()` and `->withoutTrashed()` keep
their nullable annotation because they restrict the parent to a
specific soft-delete state.
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected] >
2026-08-04 14:27:14 +02:00
Youssef Mansour and Youssef Mansour
04c8d5dd2f
Add regression test for unique() column type resolution ( #1787 )
...
Confirms string()->unique() correctly resolves to string type.
Related to barryvdh/laravel-ide-helper#1747
Co-authored-by: Youssef Mansour <[email protected] >
2026-07-10 10:41:38 +02:00
Barry vd. Heuvel
9027494e97
Remove closure in attribute test ( #1772 )
2026-03-05 21:35:19 +01:00
2fba281b14
Fix PHPDoc placement before PHP 8 class attributes and add regression tests ( #1769 )
...
* Initial plan
* Add tests for PHP class attribute placement and fix whitespace in regex
Co-authored-by: barryvdh <[email protected] >
* Add advanced edge case tests: final+nested-brackets and multiple attributes
Co-authored-by: barryvdh <[email protected] >
* Add PHP 8.5 test for closures inside attribute arguments
Co-authored-by: barryvdh <[email protected] >
* composer fix-style
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected] >
Co-authored-by: barryvdh <[email protected] >
Co-authored-by: laravel-ide-helper <[email protected] >
2026-03-04 12:00:42 +01:00
Pieter Willekens
37dfcf9e14
chore: update test snapshots after dependency upgrade ( #1762 )
2026-02-20 14:51:32 +01:00
Pieter Willekens and laravel-ide-helper
fd3cfbe09d
feat(ModelsCommand): add configuration option to disable model query methods ( #1692 )
...
* feat(ModelsCommand): add configuration option to disable model query methods
* composer fix-style
* update comment
* revert whitespace changes
* composer fix-style
* composer fix-style
---------
Co-authored-by: laravel-ide-helper <[email protected] >
2026-02-11 11:45:10 +01:00
Pieter Willekens
3bd70eafd0
fix: wrap bare intersection types in parentheses when adding nullable ( #1756 )
...
When a MorphTo relation's docblock uses a bare intersection type in the
generic parameter (e.g. `MorphTo<BaseModel&CanBeAssigned, $this>`), the
generated property type incorrectly becomes `BaseModel&CanBeAssigned|null`
instead of the correct `(BaseModel&CanBeAssigned)|null`.
This adds `wrapIntersectionType()` which ensures bare intersection types
are wrapped in parentheses before `|null` is appended, producing valid
DNF type syntax. Applied in both `setProperty()` and `applyNullability()`.
2026-02-10 15:19:29 +01:00
Barry vd. Heuvel
cff155b0d3
Replace psalm with larastan ( #1755 )
...
* Use larastan instead of psalm
* Fix cs
* Fix baseline
2026-02-07 14:32:53 +01:00
Sava and Sava Markovic
d87ec5835d
Support all DNF types from PHP RFC ( #1751 )
...
* Support all DNF types from PHP RFC
* Update failing test
---------
Co-authored-by: Sava Markovic <[email protected] >
2026-01-26 14:24:36 +01:00
Evan Burrell
b0dcd7c62f
Make Soft Deleted Relationships Nullable ( #1749 )
2026-01-11 14:34:18 +01:00
Barry vd. Heuvel
c95825a745
Fix test
2025-12-10 10:16:51 +01:00
Yannick Schinko
b106f7ee85
Add support for decimal column type ( #1739 )
...
* Add support for `decimal` column type
Previously `decimal` columns were represented with a cast. This now is no longer the case and instead the column type itself is `decimal`. This change takes that into account.
* The column type may also be `numeric`
* Update tests
2025-12-10 10:11:07 +01:00
WentTheFox
12a0d7d54c
Fix alias fake error ( #1745 )
...
* Add catch block in Alias::detectFake
* Update Alias unit tests
2025-12-10 10:09:42 +01:00
erikn69 and Joel Stein
8d00250cba
Add magic *_exists properties ( #1712 )
...
* Added magic `*_exists` properties.
* fix return datatype
* disabled by default
---------
Co-authored-by: Joel Stein <[email protected] >
2025-07-17 22:11:57 +02:00
Barry vd. Heuvel
877f5ed0a7
Trim strings and bump reflection docblock ( #1721 )
...
* Update version restraint
* UPdate snapshots
* update strings
2025-07-17 08:20:10 +02:00
Pieter Willekens
fafe264b3c
fix(ModelsCommand): use 'string' as realType for 'encrypted' casts ( #1698 )
2025-07-17 08:06:36 +02:00
Barry vd. Heuvel
83e3f39b39
Fix tests on windows ( #1720 )
...
* Update run-tests.yml
* Update snapshot
* Simplify matrix
2025-07-17 08:02:25 +02:00
laravel-ide-helper
31979ed485
composer fix-style
2025-07-17 05:52:57 +00:00
erikn69
6d96f0bd1a
Support other OS on tests ( #1715 )
2025-07-17 07:52:32 +02:00
Kristijan
cff244b9b5
fix: Fixed wrong doc for softDeletes withTrashed method ( #1688 )
2025-07-17 07:50:16 +02:00
laravel-ide-helper
4dfc08a854
composer fix-style
2025-07-17 05:24:13 +00:00
erikn69
6c4ba2ad38
Support AsCollection::of($map), AsCollection::using($class, $map) ( #1714 )
...
* Support `AsCollection::of($map)`, `AsCollection::using($class, $map)`
* test compatibility(`of($map)`,`using($class, $map)` compiled), only laravel `>=12.10`
2025-07-17 07:23:52 +02:00
erikn69
e0b2f86326
Configurable macro return type defaults ( #1711 )
2025-05-15 09:56:31 +02:00
laravel-ide-helper
cdefaeed42
composer fix-style
2025-05-14 18:21:46 +00:00
erikn69
c775aec1bb
Revert #1629 - _Allow adding custom Macroable classes_ ( #1707 )
...
* Revert #1629 - Allow adding custom Macroable classes
* Add Macros test
2025-05-14 20:21:17 +02:00
Marvin Naumann
0fa96e572d
detect default parameter from type float and adding tests for scopes with typed parameters ( #1697 )
2025-04-22 15:31:43 +02:00
8eec4f1ff5
feat(ModelsCommand): add support for the new Scope attribute ( #1694 )
...
* composer fix-style
* feat(model): add support for new Scope attribute
* composer fix-style
* snapshot
* check if class_exists for psalm
* check if class_exists for psalm
* resolve psalm issue
* remove prefix slash
* revert whitespace changes
* composer fix-style
* Update composer.json
---------
Co-authored-by: laravel-ide-helper <[email protected] >
Co-authored-by: Barry vd. Heuvel <[email protected] >
2025-04-04 16:14:00 +02:00
Tom Westrick
3d4e37798e
Fix AsArrayObject cast to be Laravel's ArrayObject ( #1675 )
2025-02-22 15:16:07 +01:00
laravel-ide-helper
154300fb06
composer fix-style
2025-01-01 12:17:43 +00:00
Mathieu TUDISCO and Barry vd. Heuvel
05d9c3cd65
Allow adding custom Macroable classes. ( #1629 )
...
* Allow adding custom Macroable classes.
* Remove duplication, tweak config
* Remove test
---------
Co-authored-by: Barry vd. Heuvel <[email protected] >
2025-01-01 13:17:20 +01:00
Nereo Berardozzi
0bbca8f5e2
Fixed generating PHPDoc for methods with class templates ( #1647 )
...
* Fixed generating PHPDoc for methods with class templates
* Fix style
* Use getter for alias template names
* Fixed missing class in static analysis
2024-12-31 17:18:28 +01:00
Barry vd. Heuvel and laravel-ide-helper
9c6380da4a
Remove php parser ( #1644 )
...
* Remove php parser
* composer fix-style
---------
Co-authored-by: laravel-ide-helper <[email protected] >
2024-12-30 12:42:35 +01:00
Barry vd. Heuvel and laravel-ide-helper
4e4da0825a
Add phpstorm meta argument hints ( #1640 )
...
* Add phpstorm meta hints
* composer fix-style
* Use php-templates from vs-code
* Fix view instance
* composer fix-style
* Add translations
* composer fix-style
* map to string
* composer fix-style
* Fix test
---------
Co-authored-by: laravel-ide-helper <[email protected] >
2024-12-29 19:44:08 +01:00
Lau Ernebjerg Josefsen
4ad74ba241
Add weak generics for array type objects ( #1621 )
2024-12-29 11:52:05 +01:00
Barry vd. Heuvel and laravel-ide-helper
347483be03
Add option for only eloquent ( #1636 )
...
* Add option for only eloquent
* composer fix-style
* Add snapshot
* Add option to models command
* composer fix-style
* Fix namespace
---------
Co-authored-by: laravel-ide-helper <[email protected] >
2024-12-29 11:51:09 +01:00
Barry vd. Heuvel and laravel-ide-helper
14fdb572bb
Update testsuite for Generator, simplify service provider and mock ( #1635 )
...
* Add templates to Eloquent
* Test generator, update constructor
* composer fix-style
* Add filename test
* UPdate test
---------
Co-authored-by: laravel-ide-helper <[email protected] >
2024-12-28 19:56:36 +01:00
Jeppe Knockaert and laravel-ide-helper
edb56754d1
Fix PHP 8.4 deprecations ( #1618 )
...
* Replace implicitly nullable parameters for PHP 8.4
* composer fix-style
---------
Co-authored-by: laravel-ide-helper <[email protected] >
2024-12-14 11:06:34 +01:00
Carl-Philipp Jung and laravel-ide-helper
e3ec773374
Improve replacement of return type for methods from Query\Builder ( #1575 )
...
* Add return type `|static` to Query\Builder methods (#1574 )
* Replace return type Query\Builder with Eloquent\Builder (#1574 )
* Replace return type Query\Builder only for facade Eloquent (#1574 )
* Add special return type replacement for Macros of \Eloquent
* Restrict special return type to methods from Eloquent\Builder and Query\Builder
* Do not overwrite return type in normalizeReturn() with conditional call of setType()
* Use generic return type for builder methods in \Eloquent
* composer fix-style
---------
Co-authored-by: laravel-ide-helper <[email protected] >
2024-10-31 15:47:27 +01:00
Barry vd. Heuvel
64588afe8b
Update snapshots
2024-10-31 15:39:02 +01:00
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
Pieter Willekens and laravel-ide-helper
07e3bd8796
fix(pivot): only use unique classes in the pivot union ( Fixes #1606 ) ( #1607 )
...
* fix(pivot): only use unique classes in the pivot union (Fixes #1606 )
* composer fix-style
---------
Co-authored-by: laravel-ide-helper <[email protected] >
2024-10-29 15:00:16 +01:00
Ramon Dantas and Barry 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 Willekens and laravel-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
KentarouTakeda
ec61b82178
Fix upstream dependent test failure ( #1595 )
2024-10-17 18:35:28 +02:00
KentarouTakeda
d3965aaab5
fix: Model's --write duplicates array properties ( #1594 )
...
* Use the bug-fixed version of the upstream library
* Updated the test for fixed features to correctly expect
2024-10-17 18:34:58 +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