1060 Commits
Author SHA1 Message Date
Stephen Jason Wang cc26683e8e fix: strip redundant builder @param tags for optional scalar defaults (#1785) 2026-08-04 14:28:01 +02:00
Thomas GnandtandClaude 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
Barry vd. Heuvel 3a53071650 Remove Laravel 11.x from integration test matrix 2026-07-10 10:50:01 +02:00
Youssef MansourandYoussef 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
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 3f742fd665 Bump actions/checkout from 6 to 7 in the deps group (#1792)
Bumps the deps group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: deps
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-10 10:41:00 +02:00
Adedayo Oyetoke e1b1ef74aa Skip incrementEach and decrementEach for Eloquent helper (#1782) 2026-05-06 11:53:44 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 7fd3b7aff0 Bump release-drafter/release-drafter from 6 to 7 in the deps group (#1776)
Bumps the deps group with 1 update: [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter).


Updates `release-drafter/release-drafter` from 6 to 7
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v6...v7)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: deps
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 12:40:07 +02:00
Barry vd. Heuvel 1002cb567d Update branch alias from 3.6-dev to 3.7-dev 2026-03-17 16:27:12 +01:00
barryvdh 3e0c12ee0e Update CHANGELOG 2026-03-17 15:27:00 +00:00
Jesper Noordsij ad7e37676f Bump branch alias to 3.6 (#1774) v3.7.0 2026-03-17 15:12:51 +01:00
Barry vd. Heuvel 9027494e97 Remove closure in attribute test (#1772) 2026-03-05 21:35:19 +01:00
isaackaara c3f795e909 fix: skip autoload exception when class existence is being checked (#1764)
The MetaCommand's custom autoloader throws a ReflectionException for any
class not found during meta generation. However, this breaks libraries
that use class_exists() to check for optional dependencies before loading
them (e.g. Doctrine ORM checking for StaticReflectionService removed in
doctrine/persistence v4).

This fix checks the call stack (up to 3 frames) for class_exists(),
interface_exists(), trait_exists(), or enum_exists() calls and returns
gracefully instead of throwing, allowing the existence check to return
false as expected.

Fixes #1750
2026-03-04 17:15:04 +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
laravel-ide-helper 39bcb60b7c composer fix-style 2026-03-04 09:53:06 +00:00
isaackaara 16f685aa9f fix: don't extend root's parent class for facade stubs in helper file (#1766)
Since #1674 (commit 09623f2), the generated IDE helper file adds an
`extends` declaration for Macroable classes to expose inherited methods.
However, the check to skip facades only excluded classes in the
`\Illuminate\Support\Facades` namespace, so third-party facades (e.g.
`Spatie\Menu\Laravel\Facades\Menu`) would incorrectly extend the
facade root's parent class.

This caused the generated stub to conflict with the real facade class:

    namespace Spatie\Menu\Laravel\Facades {
        class Menu extends \Spatie\Menu\Menu {  // wrong!

The fix checks whether the extends class IS a Facade subclass (using
`is_subclass_of`) rather than comparing namespace strings. This
correctly excludes ALL facade classes (both Laravel and third-party)
while still allowing non-facade Macroable classes to extend their
parent.

Fixes #1724
2026-03-04 10:52:43 +01:00
isaackaara 392d5cfc80 fix: place PHPDoc before class attributes when writing to models (#1765)
When using --write/-W with models that have PHP 8 attributes (e.g.
#[ObservedBy(...)]), the generated PHPDoc block was inserted between
the attribute and the class declaration:

    #[ObservedBy([ImageObserver::class])]
    /**
     * @property string $name
     */
    final class Image extends Model

This breaks PHPStan/Larastan because the docblock must come before
the attributes. The fix scans backward from the class declaration to
find any preceding PHP 8 attributes and inserts the docblock before
them:

    /**
     * @property string $name
     */
    #[ObservedBy([ImageObserver::class])]
    final class Image extends Model

Fixes #1734
2026-03-04 10:52:03 +01:00
isaackaara 3d8fccd700 fix: correct indentation in camel case config comment block (#1767)
The 'Support for camel cased models' comment block used 5-space
indentation for the pipe characters instead of the standard 4 spaces
used by all other comment blocks in the config file.

Fixes #1761
2026-03-04 10:48:05 +01:00
Laravel ShiftandBarry vd. Heuvel e9b62b6ee0 Laravel 13.x Compatibility (#1763)
* Bump dependencies for Laravel 13

* Update GitHub Actions for Laravel 13

* Update workflow to remove cron schedule

Removed cron schedule and adjusted pull request branches.

* Fix syntax, modify Laravel version in run-tests.yml

Updated Laravel version from '13.0' to '13.x' in CI configuration.

* Update test-ci command in composer.json

* Fix test-ci command in composer.json

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
2026-02-21 09:54:37 +01:00
Pieter Willekens 37dfcf9e14 chore: update test snapshots after dependency upgrade (#1762) 2026-02-20 14:51:32 +01:00
Pieter Willekens 573c9f3f57 ci: add PHP 8.5 to integration test matrix (#1760)
The unit test matrix already includes PHP 8.5 but it was missing
from the integration tests.
2026-02-11 11:45:28 +01:00
Pieter Willekensandlaravel-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
Pieter Willekens 5aca186d92 perf: reduce redundant lookups and file I/O in generation hot paths (#1757)
- Convert usedMethods from list to hash map for O(1) dedup lookups
- Cache getRelationTypes() and getRelationReturnTypes() per command run
- Reuse SplFileObject instances by filename instead of re-opening per method
- Cache ContextFactory results per declaring class across docblock helpers

Benchmarked with hyperfine (10 runs, 2 warmup): 1.37x faster (~27%).
2026-02-10 15:18:58 +01:00
barryvdh 148f956272 normalize composer.json 2026-02-07 13:33:03 +00: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
SavaandSava 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
JaspurandBarry vd. Heuvel 2ac73f2953 Skip calling fake() when required parameters exist (Socialite compatibility) (#1746)
* Skip calling fake() on facades that require parameters (fix Socialite error)

The ide-helper attempted to invoke Facade::fake() unconditionally, which
breaks when a facade (such as Laravel Socialite) requires a mandatory
parameter in its fake() method signature. This resulted in an
ArgumentCountError during `php artisan ide-helper:generate`.

This patch adds a ReflectionMethod check and skips calling fake() when
required parameters are present, ensuring compatibility with Socialite
and preserving expected behavior for facades that support parameterless
faking.

* Update Alias.php

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
2025-12-10 10:31:15 +01:00
Barry vd. Heuvel c95825a745 Fix test 2025-12-10 10:16:51 +01:00
barryvdh db606f30d1 Update CHANGELOG 2025-12-10 09:12:44 +00: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
v3.6.1
2025-12-10 10:11:07 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> d61d20357e Bump the deps group across 1 directory with 2 updates (#1743)
Bumps the deps group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action).


Updates `actions/checkout` from 5 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

Updates `stefanzweifel/git-auto-commit-action` from 6 to 7
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: deps
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: deps
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-10 10:10:25 +01:00
Jesper Noordsij e9283c40a2 Remove calls to PHP 8.5-deprecated setAccessible (#1744)
These are no-op as of PHP 8.1 and thus no longer needed

See also https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
2025-12-10 10:10:09 +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
Serhii Petrov 9ef25f60e7 Add php 8.5 support (#1735) 2025-10-01 15:12:26 +02:00
Keita Shima 8dff6bb5ff Fix typos in documentation and code comments (#1733)
- Fixed 'seperate' to 'separate' in README.md (2 occurrences)
- Fixed 'columname' to 'columnname' in README.md (2 occurrences)
- Fixed 'Wether' to 'Whether' in src/Method.php PHPDoc comments (2 occurrences)
2025-09-15 14:14:26 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 53854ea7d9 Bump actions/checkout from 4 to 5 in the deps group (#1731)
Bumps the deps group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 4 to 5
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: deps
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-02 16:32:00 +02:00
Peter Jørgensen 1fa84a3b65 fix methodsto typo (#1723) 2025-08-04 15:07:10 +02:00
barryvdh 5e973967a7 Update CHANGELOG 2025-07-18 14:10:29 +00:00
erikn69andJoel Stein 8d00250cba Add magic *_exists properties (#1712)
* Added magic `*_exists` properties.

* fix return datatype

* disabled by default

---------

Co-authored-by: Joel Stein <[email protected]>
v3.6.0
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
erikn69 108f6269c1 Update .gitattributes - avoid all .php-cs-fixer files on vendor (#1708) 2025-07-17 08:02:50 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> c488262f97 Bump stefanzweifel/git-auto-commit-action from 5 to 6 in the deps group (#1719)
Bumps the deps group with 1 update: [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action).


Updates `stefanzweifel/git-auto-commit-action` from 5 to 6
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: deps
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-17 08:02:35 +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