Commit Graph
144 Commits
Author SHA1 Message Date
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
Barry vd. Heuvelandlaravel-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. Heuvelandlaravel-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. Heuvelandlaravel-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
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 Willekensandlaravel-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 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
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
uno-sw 7d2ea97f25 Update test 2024-08-02 13:21:45 +09:00
Barry vd. Heuvel 2dba19133c Fix style again (#1569) 2024-07-12 16:16:37 +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
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
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
6579c0332b Remove doctrine (#1512)
* Remove doctrine

* Fix tests

* normalize composer.json

* Add back platform

* Bump integration versions

* composer fix-style

* Fix stability

* Bump minimum to 10.36

* Bump minimum to 10.38

* More types

* Fast fail off

* Bump docblock

* composer fix-style

* add bpchar

* Use match for type detection

Co-authored-by: Hafez Divandari <[email protected]>

* Use driverName

Co-authored-by: Hafez Divandari <[email protected]>

* fix match

* TWeak types

* Update snapshots

* Remove testbench 7

* composer fix-style

* Update src/Console/ModelsCommand.php

Co-authored-by: Hafez Divandari <[email protected]>

* Update src/Console/ModelsCommand.php

Co-authored-by: Hafez Divandari <[email protected]>

* Tweak bool

* Update src/Console/ModelsCommand.php

Co-authored-by: Hafez Divandari <[email protected]>

* composer fix-style

* Remove custom types, default to string

---------

Co-authored-by: barryvdh <[email protected]>
Co-authored-by: laravel-ide-helper <[email protected]>
Co-authored-by: Hafez Divandari <[email protected]>
2024-02-17 11:12:12 +01:00
Markus Podar bcc233280b [TEST] Show that custom phpdoc tags without space afterwards are unexpectedly changed (#981)
* tests: show that custom phpdoc tags without space afterwards are unexpectedly changed

This adds a test for the (current bug) behaviour of https://github.com/barryvdh/laravel-ide-helper/issues/666

If this ever gets fixed, this fails and needs to be adapted,
ensuring it won't break again.

* test: adapt now that #666 has been fixed
2024-02-16 21:38:43 +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
GeoSot bc158a1b86 Add AllowDynamicProperties Attribute to cooperate with php8.2 deprecation (#1428)
* Add `AllowDynamicProperties` Attribute to cooperate with php8.2 deprecation

* lint snapshot
2024-02-08 11:09:30 +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
Menthol cee441c87c Fix #1300 relation_return_type must take precedence if it is defined (#1394) 2024-02-08 09:48:26 +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 2535f8e6ab Fix tests and CS 2024-02-07 21:44:48 +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