Showing preview only (828K chars total). Download the full file or copy to clipboard to get everything.
Repository: barryvdh/laravel-ide-helper
Branch: master
Commit: 1002cb567df7
Files: 286
Total size: 745.3 KB
Directory structure:
gitextract_re81t364/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── 1_Bug_report.md
│ │ ├── 2_Feature_request.md
│ │ └── 3_Support_question.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── dependabot.yaml
│ ├── release-drafter.yml
│ ├── stale.yml
│ └── workflows/
│ ├── composer-normalize.yml
│ ├── fix-code-style.yml
│ ├── release-drafter.yml
│ ├── run-integration-tests.yml
│ ├── run-static-analysis.yml
│ ├── run-tests.yml
│ └── update-changelog.yaml
├── .gitignore
├── .php-cs-fixer.common.php
├── .php-cs-fixer.dist.php
├── .php-cs-fixer.tests.php
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── composer.json
├── config/
│ └── ide-helper.php
├── php-templates/
│ ├── LICENSE.md
│ ├── README.md
│ ├── auth.php
│ ├── configs.php
│ ├── middleware.php
│ ├── routes.php
│ ├── translations.php
│ └── views.php
├── phpstan-baseline.neon
├── phpstan.neon
├── phpunit.xml.dist
├── resources/
│ └── views/
│ ├── helper.php
│ └── meta.php
├── src/
│ ├── Alias.php
│ ├── Console/
│ │ ├── EloquentCommand.php
│ │ ├── GeneratorCommand.php
│ │ ├── MetaCommand.php
│ │ └── ModelsCommand.php
│ ├── Contracts/
│ │ └── ModelHookInterface.php
│ ├── Eloquent.php
│ ├── Generator.php
│ ├── IdeHelperServiceProvider.php
│ ├── Listeners/
│ │ └── GenerateModelHelper.php
│ ├── Macro.php
│ ├── Method.php
│ └── Parsers/
│ └── PhpDocReturnTypeParser.php
└── tests/
├── AliasTest.php
├── Console/
│ ├── EloquentCommandTest.php
│ ├── GeneratorCommand/
│ │ ├── AbstractGeneratorCommand.php
│ │ ├── GenerateEloquentOnly/
│ │ │ └── Test.php
│ │ └── GenerateIdeHelper/
│ │ └── Test.php
│ ├── MetaCommand/
│ │ └── MetaCommandTest.php
│ ├── ModelsCommand/
│ │ ├── AbstractModelsCommand.php
│ │ ├── AdvancedCasts/
│ │ │ ├── Collections/
│ │ │ │ ├── AdvancedCastCollection.php
│ │ │ │ └── AdvancedCastMap.php
│ │ │ ├── Enums/
│ │ │ │ └── AdvancedCastEnum.php
│ │ │ ├── Models/
│ │ │ │ └── AdvancedCast.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── AllowGlobDirectory/
│ │ │ ├── Services/
│ │ │ │ └── Post/
│ │ │ │ └── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── ArrayCastsWithComment/
│ │ │ ├── Models/
│ │ │ │ └── ArrayCastsWithComment.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Attributes/
│ │ │ ├── Models/
│ │ │ │ ├── BackedAttribute.php
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Comment/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── CustomCollection/
│ │ │ ├── Collections/
│ │ │ │ └── SimpleCollection.php
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── CustomDate/
│ │ │ ├── Models/
│ │ │ │ └── CustomDate.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── CustomPhpdocTags/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__testNoSpaceAfterCustomPhpdocTag__1.php
│ │ ├── DnfTypes/
│ │ │ ├── Models/
│ │ │ │ └── DnfTypeModel.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── DoesNotGeneratePhpdocWithExternalEloquentBuilder/
│ │ │ ├── Builders/
│ │ │ │ └── PostExternalQueryBuilder.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── DynamicRelations/
│ │ │ ├── Models/
│ │ │ │ └── Dynamic.php
│ │ │ ├── OtherModels/
│ │ │ │ └── Account.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Factories/
│ │ │ ├── CustomSpace/
│ │ │ │ └── ModelWithCustomNamespaceFactory.php
│ │ │ ├── Factories/
│ │ │ │ ├── ModelWithFactoryFactory.php
│ │ │ │ └── ModelWithNestedFactoryFactory.php
│ │ │ ├── Models/
│ │ │ │ ├── ModelWithCustomNamespace.php
│ │ │ │ ├── ModelWithFactory.php
│ │ │ │ ├── ModelWithNestedFactory.php
│ │ │ │ └── ModelWithoutFactory.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__testFactory__1.php
│ │ ├── GenerateBasicPhpDocWithEnumDefaults/
│ │ │ ├── Enums/
│ │ │ │ └── PostStatus.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateBasicPhpdoc/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateBasicPhpdocCamel/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateBasicPhpdocFinal/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateBasicPhpdocWithEloquentHelper/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateMixinCollection/
│ │ │ ├── Models/
│ │ │ │ └── WithCollection.php
│ │ │ ├── NonModels/
│ │ │ │ ├── CollectionModel.php
│ │ │ │ └── NonModel.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpDocWithTypedScopeParameter/
│ │ │ ├── Models/
│ │ │ │ └── Comment.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithExternalEloquentBuilder/
│ │ │ ├── Builders/
│ │ │ │ └── PostExternalQueryBuilder.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithExternalEloquentBuilderWithFqn/
│ │ │ ├── Builders/
│ │ │ │ └── PostExternalQueryBuilder.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithForcedFqn/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithFqn/
│ │ │ ├── Casts/
│ │ │ │ └── CastType.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithFqnInExternalFile/
│ │ │ ├── Builders/
│ │ │ │ └── EMaterialQueryBuilder.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithMixin/
│ │ │ ├── Models/
│ │ │ │ ├── FinalPost.php
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenericsSyntaxDisabled/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Getter/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Ignored/
│ │ │ ├── Models/
│ │ │ │ ├── Ignored.php
│ │ │ │ └── NotIgnored.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Interfaces/
│ │ │ ├── Models/
│ │ │ │ └── User.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── LaravelCustomCasts/
│ │ │ ├── Casts/
│ │ │ │ ├── CastableReturnsAnonymousCaster.php
│ │ │ │ ├── CastableReturnsCustomCaster.php
│ │ │ │ ├── CastableWithoutReturnType.php
│ │ │ │ ├── CastedProperty.php
│ │ │ │ ├── CustomCasterWithDocblockReturn.php
│ │ │ │ ├── CustomCasterWithDocblockReturnFqn.php
│ │ │ │ ├── CustomCasterWithNullablePrimitiveReturn.php
│ │ │ │ ├── CustomCasterWithParam.php
│ │ │ │ ├── CustomCasterWithPrimitiveDocblockReturn.php
│ │ │ │ ├── CustomCasterWithPrimitiveReturn.php
│ │ │ │ ├── CustomCasterWithReturnType.php
│ │ │ │ ├── CustomCasterWithStaticReturnType.php
│ │ │ │ ├── CustomCasterWithoutReturnType.php
│ │ │ │ ├── ExtendedSelfCastingCasterWithStaticDocblockReturn.php
│ │ │ │ ├── ExtendedSelfCastingCasterWithThisDocblockReturn.php
│ │ │ │ ├── InboundAttributeCaster.php
│ │ │ │ ├── SelfCastingCasterWithStaticDocblockReturn.php
│ │ │ │ └── SelfCastingCasterWithThisDocblockReturn.php
│ │ │ ├── Models/
│ │ │ │ └── CustomCast.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── MagicWhere/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── ModelHooks/
│ │ │ ├── Hooks/
│ │ │ │ ├── CustomMethod.php
│ │ │ │ ├── CustomProperty.php
│ │ │ │ └── UnsetMethod.php
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── MorphToIntersection/
│ │ │ ├── Models/
│ │ │ │ ├── BaseModel.php
│ │ │ │ ├── CanBeAssigned.php
│ │ │ │ └── MorphToIntersection.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Morphs/
│ │ │ ├── Models/
│ │ │ │ └── Morphs.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── PHPStormNoInspection/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ ├── Test__testNoinspectionNotPresent__1.php
│ │ │ └── Test__testNoinspectionPresent__1.php
│ │ ├── PhpAttributesBeforeClass/
│ │ │ ├── Models/
│ │ │ │ ├── FinalWithNested.php
│ │ │ │ ├── MultipleAttributes.php
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Pivot/
│ │ │ ├── Models/
│ │ │ │ ├── ModelWithPivot.php
│ │ │ │ └── Pivots/
│ │ │ │ ├── CustomPivot.php
│ │ │ │ └── DifferentCustomPivot.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── QueryMethods/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── QueryScopes/
│ │ │ ├── Models/
│ │ │ │ ├── Comment.php
│ │ │ │ ├── Post.php
│ │ │ │ └── PostParent.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── RelationCountProperties/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Relations/
│ │ │ ├── Models/
│ │ │ │ ├── BelongsToVariation.php
│ │ │ │ ├── CompositeBelongsToVariation.php
│ │ │ │ └── Simple.php
│ │ │ ├── ModelsOtherNamespace/
│ │ │ │ └── AnotherModel.php
│ │ │ ├── Test.php
│ │ │ ├── Traits/
│ │ │ │ └── HasTestRelations.php
│ │ │ ├── Types/
│ │ │ │ ├── SampleToAnyMorphedRelationType.php
│ │ │ │ ├── SampleToAnyRelationType.php
│ │ │ │ ├── SampleToBadlyNamedNotManyRelationType.php
│ │ │ │ ├── SampleToManyRelationType.php
│ │ │ │ └── SampleToOneRelationType.php
│ │ │ └── __snapshots__/
│ │ │ ├── Test__testRelationNotNullable__1.php
│ │ │ └── Test__test__1.php
│ │ ├── ResetAndSmartReset/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ ├── Test__testNoReset__1.php
│ │ │ ├── Test__testReset__1.php
│ │ │ └── Test__testSmartReset__1.php
│ │ ├── SimpleCasts/
│ │ │ ├── Models/
│ │ │ │ └── SimpleCast.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── SoftDeletes/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── SoftDeletesRelations/
│ │ │ ├── Models/
│ │ │ │ ├── ModelWithRelations.php
│ │ │ │ ├── NonSoftDeletableModel.php
│ │ │ │ └── SoftDeletableModel.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ ├── Test__testSoftDeletesForceNullableDisabled__1.php
│ │ │ └── Test__test__1.php
│ │ ├── UnionTypes/
│ │ │ ├── Models/
│ │ │ │ └── UnionTypeModel.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Variadic/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ └── migrations/
│ │ ├── ____advanced_casts_table.php
│ │ ├── ____backed_attribute_table.php
│ │ ├── ____belongs_to_variation_table.php
│ │ ├── ____custom_casts_table.php
│ │ ├── ____custom_dates_table.php
│ │ ├── ____morphs_table.php
│ │ ├── ____posts_table.php
│ │ ├── ____simple_casts_table.php
│ │ ├── ____simple_table.php
│ │ └── ____soft_deletes_relations_table.php
│ └── __snapshots__/
│ └── EloquentCommandTest__testCommand__1.txt
├── MacroTest.php
├── MethodTest.php
├── RealTimeFacadesTest.php
├── SnapshotPhpDriver.php
├── SnapshotTxtDriver.php
├── TestCase.php
└── stubs/
├── facade-0e0385307adf5db34c7986ecbd11646061356ec8.php
└── facade-9431b04ec1494fc71a1bc848f020044aba2af7b1.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
================================================
FILE: .gitattributes
================================================
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
# Ignore all test and documentation with "export-ignore".
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.php-cs-fixer* export-ignore
/phpunit.xml.dist export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
/tests export-ignore
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: barryvdh
custom: ['https://fruitcake.nl']
================================================
FILE: .github/ISSUE_TEMPLATE/1_Bug_report.md
================================================
---
name: "🐛 Bug Report"
about: 'Report a general bug.'
labels: bug
---
### Versions:
- ide-helper Version: #.#.#
- Laravel Version: #.#.# <!-- remove if not applicable -->
- PHP Version: #.#.#
### Description:
<!--
Please describe in detail the nature of the bug, code samples, etc.
The more, the better.
-->
### Steps To Reproduce:
- …
================================================
FILE: .github/ISSUE_TEMPLATE/2_Feature_request.md
================================================
---
name: "✨ Feature request"
about: 'Suggest a new feature or other improvements.'
labels: enhancement
---
### Summary
<!--
Describe in detail what you propose, show (preferable) code examples and also signal if you're willing to work on it!
-->
================================================
FILE: .github/ISSUE_TEMPLATE/3_Support_question.md
================================================
---
name: "🙋🏼♂️ Support question"
about: 'I need assistance or clarification on usage of this library.'
labels: question
---
### Versions:
- ide-helper Version: #.#.#
- Laravel Version: #.#.# <!-- remove if not applicable -->
- PHP Version: #.#.#
### Question:
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
## Summary
<!-- Please provide an exhaustive description. -->
## Type of change
<!-- Please delete options that are not relevant. -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Misc. change (internal, infrastructure, maintenance, etc.)
### Checklist
- [ ] Existing tests have been adapted and/or new tests have been added
- [ ] Update the README.md
- [ ] Code style has been fixed via `composer fix-style`
================================================
FILE: .github/dependabot.yaml
================================================
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
deps:
patterns:
- '*'
================================================
FILE: .github/release-drafter.yml
================================================
template: |
## What’s Changed
$CHANGES
================================================
FILE: .github/stale.yml
================================================
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 60
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- enhancement
- discussion
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
If this issue is still present on the latest version of this library on supported Laravel versions,
please let us know by replying to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
# Limit to only `issues` or `pulls`
only: issues
================================================
FILE: .github/workflows/composer-normalize.yml
================================================
name: normalize composer.json
on:
push:
paths:
- .github/workflows/composer-normalize.yml
- composer.json
jobs:
normalize:
timeout-minutes: 15
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v6
- name: Validate Composer configuration
run: composer validate --strict
- name: Normalize composer.json
run: |
composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true
composer global require ergebnis/composer-normalize
composer normalize
- uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: normalize composer.json
================================================
FILE: .github/workflows/fix-code-style.yml
================================================
name: Fix Code Style
on:
push:
jobs:
fix-style:
name: Fix Code Style
timeout-minutes: 15
runs-on: ubuntu-22.04
env:
COMPOSER_NO_INTERACTION: 1
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
- name: Install dependencies
run: composer update --prefer-dist --no-progress
- run: composer fix-style
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: composer fix-style
commit_author: laravel-ide-helper <laravel-ide-helper@users.noreply.github.com>
================================================
FILE: .github/workflows/release-drafter.yml
================================================
name: Release Drafter
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# types: [opened, reopened, synchronize]
permissions:
contents: read
jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/run-integration-tests.yml
================================================
name: Integration Tests
on:
push:
branches:
- master
pull_request:
branches:
- "*"
jobs:
php-laravel-integration-tests:
runs-on: ubuntu-22.04
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
strategy:
fail-fast: false
matrix:
php: [8.5, 8.4, 8.3, 8.2]
laravel: [11.x, 12.x, 13.x]
exclude:
- laravel: 13.x
php: 8.2
name: P${{ matrix.php }} - Laravel${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
path: src
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Install dependencies
run: |
composer create-project --prefer-dist laravel/laravel:${{ matrix.laravel }} --stability=dev --no-progress sample
cd sample
composer config minimum-stability dev
composer update --prefer-stable --prefer-dist --no-progress
- name: Add package from source
run: |
cd sample
sed -e 's|"type": "project",|&\n"repositories": [ { "type": "path", "url": "../src" } ],|' -i composer.json
composer require --dev "barryvdh/laravel-ide-helper:*" --with-all-dependencies
- name: Execute generate run
run: |
cd sample
php artisan ide-helper:generate
- name: Execute meta run
run: |
cd sample
php artisan ide-helper:meta -v
- name: Check file existence
run: |
ls sample/_ide_helper.php
ls sample/.phpstorm.meta.php
- name: Check logs
run: |
if [ `ls -1q "sample/storage/logs/" | wc -l` -gt 0 ]; then
for logfile in sample/storage/logs/*; do
echo "-- $logfile --"
cat $logfile
done
exit 1
fi
================================================
FILE: .github/workflows/run-static-analysis.yml
================================================
name: Run Static Analysis
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
build:
timeout-minutes: 15
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
extensions: pdo_sqlite
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Analyze
run: vendor/bin/phpstan --no-progress --error-format=github
================================================
FILE: .github/workflows/run-tests.yml
================================================
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- "*"
jobs:
php-tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
COMPOSER_NO_INTERACTION: 1
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.5, 8.4, 8.3, 8.2]
laravel: [12.x, 13.x, ~11.15]
stability: [prefer-lowest, prefer-stable]
include:
- os: windows-latest
php: 8.3
laravel: 12.x
stability: prefer-stable
exclude:
- laravel: 13.x
php: 8.2
steps:
- name: Set git to use LF
if: "${{ matrix.os == 'windows-latest' }}"
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_sqlite, fileinfo
- name: Install dependencies
run: |
composer remove vimeo/psalm --no-update --dev
composer remove friendsofphp/php-cs-fixer --no-update --dev
composer require "laravel/framework:${{ matrix.laravel }}" --no-update --no-progress
composer update --prefer-dist --no-progress --${{ matrix.stability }}
- name: Execute Unit Tests
run: composer test-ci
================================================
FILE: .github/workflows/update-changelog.yaml
================================================
name: "Update Changelog"
on:
release:
types: [released]
jobs:
update:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# updated CHANGELOG back to the repository.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.event.release.target_commitish }}
- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.tag_name }}
release-notes: ${{ github.event.release.body }}
- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v7
with:
branch: ${{ github.event.release.target_commitish }}
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
================================================
FILE: .gitignore
================================================
.phpunit.result.cache
/auth.json
/build
/.idea
/.php-cs-fixer.cache
/.php-cs-fixer.php
/.php-cs-fixer.tests.cache
/composer.lock
/vendor
================================================
FILE: .php-cs-fixer.common.php
================================================
<?php
// Share common rules between non-test and test files
return [
'@PSR12' => true,
'blank_line_after_opening_tag' => true,
'braces' => [
'allow_single_line_anonymous_class_with_empty_body' => true,
],
'compact_nullable_typehint' => true,
'declare_equal_normalize' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'new_with_braces' => true,
'no_blank_lines_after_class_opening' => true,
'no_leading_import_slash' => true,
'no_whitespace_in_blank_line' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
],
],
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'alpha',
],
'return_type_declaration' => true,
'short_scalar_cast' => true,
'single_trait_insert_per_statement' => true,
'ternary_operator_spaces' => true,
'visibility_required' => [
'elements' => [
'const',
'method',
'property',
],
],
// Further quality-of-life improvements
'array_syntax' => [
'syntax' => 'short',
],
'concat_space' => [
'spacing' => 'one',
],
'fully_qualified_strict_types' => true,
'native_function_invocation' => [
'include' => [],
'strict' => true,
],
'no_unused_imports' => true,
'single_quote' => true,
'space_after_semicolon' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
];
================================================
FILE: .php-cs-fixer.dist.php
================================================
<?php
require __DIR__ . '/vendor/autoload.php';
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude(['tests', 'build']);
$config = require __DIR__ . '/.php-cs-fixer.common.php';
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRules($config)
->setRiskyAllowed(true)
->setCacheFile(__DIR__ . '/.php-cs-fixer.cache');
================================================
FILE: .php-cs-fixer.tests.php
================================================
<?php
require __DIR__ . '/vendor/autoload.php';
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/tests')
->exclude('__snapshots__');
$config = require __DIR__ . '/.php-cs-fixer.common.php';
// Additional rules for tests
$config = array_merge(
$config,
[
'declare_strict_types' => true,
]
);
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRules($config)
->setRiskyAllowed(true)
->setCacheFile(__DIR__ . '/.php-cs-fixer.tests.cache');
================================================
FILE: CHANGELOG.md
================================================
# Changelog
## v3.7.0 - 2026-03-17
### What's Changed
* Skip calling fake() when required parameters exist (Socialite compatibility) by @Jaspur in https://github.com/barryvdh/laravel-ide-helper/pull/1746
* Make Soft Deleted Relationships Nullable by @evan-burrell in https://github.com/barryvdh/laravel-ide-helper/pull/1749
* Support all DNF types from PHP RFC by @gurmanolog in https://github.com/barryvdh/laravel-ide-helper/pull/1751
* Replace psalm with larastan by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1755
* perf: reduce redundant lookups and file I/O in generation hot paths by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1757
* fix: wrap bare intersection types in parentheses when adding nullable by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1756
* feat(ModelsCommand): add configuration option to disable model query methods by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1692
* ci: add PHP 8.5 to integration test matrix by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1760
* chore: update test snapshots after merge order issue by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1762
* Laravel 13.x Compatibility by @laravel-shift in https://github.com/barryvdh/laravel-ide-helper/pull/1763
* fix: Correct indentation in camel case config comment block by @isaackaara in https://github.com/barryvdh/laravel-ide-helper/pull/1767
* fix: Place PHPDoc before class attributes when writing to models by @isaackaara in https://github.com/barryvdh/laravel-ide-helper/pull/1765
* fix: Don't extend root's parent class for facade stubs in helper file by @isaackaara in https://github.com/barryvdh/laravel-ide-helper/pull/1766
* Fix PHPDoc placement before PHP 8 class attributes and add regression tests by @Copilot in https://github.com/barryvdh/laravel-ide-helper/pull/1769
* fix: Skip autoload exception when class existence is being checked by @isaackaara in https://github.com/barryvdh/laravel-ide-helper/pull/1764
* Remove closure in attribute test by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1772
* Bump branch alias to 3.6 by @jnoordsij in https://github.com/barryvdh/laravel-ide-helper/pull/1774
### New Contributors
* @Jaspur made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1746
* @evan-burrell made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1749
* @gurmanolog made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1751
* @laravel-shift made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1763
* @isaackaara made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1767
* @Copilot made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1769
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.6.1...v3.7.0
## v3.6.1 - 2025-12-10
### What's Changed
* Fix `methodsto` typo in README by @peterchrjoergensen in https://github.com/barryvdh/laravel-ide-helper/pull/1723
* Bump actions/checkout from 4 to 5 in the deps group by @dependabot[bot] in https://github.com/barryvdh/laravel-ide-helper/pull/1731
* Fix typos in documentation and code comments by @kei1111 in https://github.com/barryvdh/laravel-ide-helper/pull/1733
* Add php 8.5 support by @sergiy-petrov in https://github.com/barryvdh/laravel-ide-helper/pull/1735
* Fix alias fake error by @WentTheFox in https://github.com/barryvdh/laravel-ide-helper/pull/1745
* Remove calls to PHP 8.5-deprecated `setAccessible` by @jnoordsij in https://github.com/barryvdh/laravel-ide-helper/pull/1744
* Bump the deps group across 1 directory with 2 updates by @dependabot[bot] in https://github.com/barryvdh/laravel-ide-helper/pull/1743
* Add support for `decimal` column type by @BrainStone in https://github.com/barryvdh/laravel-ide-helper/pull/1739
### New Contributors
* @peterchrjoergensen made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1723
* @kei1111 made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1733
* @WentTheFox made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1745
* @BrainStone made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1739
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.6.0...v3.6.1
## v3.6.0 - 2025-07-18
### What's Changed
* fix: Change AsArrayObject cast to be Laravel's ArrayObject by @wsamoht in https://github.com/barryvdh/laravel-ide-helper/pull/1675
* Add extends declaration for Macroable classes to fix missing inherited methods by @KentarouTakeda in https://github.com/barryvdh/laravel-ide-helper/pull/1674
* fix(meta): ignore aliases in the autoloader (Fixes #1671) by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1686
* feat(ModelsCommand): add support for the new Scope attribute by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1694
* fix type change for scope default float parameter by @nivseb in https://github.com/barryvdh/laravel-ide-helper/pull/1697
* Revert #1629 - *Allow adding custom Macroable classes* by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1707
* Configurable macro return type defaults by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1711
* docs(readme): add Laravel 12 support information by @SantosVilanculos in https://github.com/barryvdh/laravel-ide-helper/pull/1717
* Add multi-level directory support for translation files by @RosiersRobin in https://github.com/barryvdh/laravel-ide-helper/pull/1718
* Support `AsCollection::of($map)`, `AsCollection::using($class, $map)` by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1714
* fix: Fixed wrong doc for SoftDeletes `withTrashed` method by @eldair in https://github.com/barryvdh/laravel-ide-helper/pull/1688
* Support other OS on tests by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1715
* Fix tests on windows by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1720
* Bump stefanzweifel/git-auto-commit-action from 5 to 6 in the deps group by @dependabot[bot] in https://github.com/barryvdh/laravel-ide-helper/pull/1719
* Update .gitattributes - avoid all `.php-cs-fixer` files on vendor by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1708
* fix(ModelsCommand): use 'string' as realType for 'encrypted' casts by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1698
* Trim strings and bump reflection docblock by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1721
* Add magic *_exists properties by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1712
### New Contributors
* @wsamoht made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1675
* @nivseb made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1697
* @SantosVilanculos made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1717
* @RosiersRobin made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1718
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.5.5...v3.6.0
## v3.5.5 - 2025-02-21
### What's Changed
* Fix for incorrect config item types in meta file by @eldair in https://github.com/barryvdh/laravel-ide-helper/pull/1662
* Prevent generation of incorrect property annotation by @skyler544 in https://github.com/barryvdh/laravel-ide-helper/pull/1665
* Fix MorphTo Model Doc Generation by @yparitcher in https://github.com/barryvdh/laravel-ide-helper/pull/1668
* Laravel 12 support by @jonnott in https://github.com/barryvdh/laravel-ide-helper/pull/1672
### New Contributors
* @eldair made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1662
* @skyler544 made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1665
* @yparitcher made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1668
* @jonnott made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1672
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.5.4...v3.5.5
## v3.5.4 - 2025-01-14
### What's Changed
* Convert auth() helper to use Auth facade by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1656
* Check if returnType from docblock is not null by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1658
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.5.3...v3.5.4
## v3.5.3 - 2025-01-08
### What's Changed
* Catch meta, tweak auth by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1654
* Check if macro is valid by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1655
* feat: use generics of return type to determine resulting models by @Bloemendaal in https://github.com/barryvdh/laravel-ide-helper/pull/1653
### New Contributors
* @Bloemendaal made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1653
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.5.2...v3.5.3
## v3.5.2 - 2025-01-06
### Fixes
Fix empty/anonymous closure in meta command.
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.5.1...v3.5.2
## v3.5.1 - 2025-01-06
### What's Changed
* Remove duplicate config, fix ->can() by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1650
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.5.0...v3.5.1
## v3.5.0 - 2025-01-06
### What's Changed
* Add phpstorm meta argument hints by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1640
* Add meta override for user return types by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1642
* Use forked ContextFactory by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1643
* Remove php parser by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1644
* Also add eloquent template tags from base class by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1645
* Add more metadata by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1646
* Fixed generating PHPDoc for methods with class templates by @chack1172 in https://github.com/barryvdh/laravel-ide-helper/pull/1647
* Feat guess macro types by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1648
* Allow adding custom Macroable classes. by @mathieutu in https://github.com/barryvdh/laravel-ide-helper/pull/1629
* Add special `dev` to composer keywords by @jnoordsij in https://github.com/barryvdh/laravel-ide-helper/pull/1649
### New Contributors
* @chack1172 made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1647
* @mathieutu made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1629
* @jnoordsij made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1649
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.4.0...v3.5.0
## v3.4.0 - 2024-12-29
### What's Changed
* fix: add @template TModel of static for Eloquent by @imzyf in https://github.com/barryvdh/laravel-ide-helper/pull/1631
* Add templates to Eloquent by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1634
* Update testsuite for Generator, simplify service provider and mock by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1635
* Add option for only eloquent by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1636
* Add weak generics for array type objects by @LauJosefsen in https://github.com/barryvdh/laravel-ide-helper/pull/1621
* Make all "note" in README apply quote style by @hms5232 in https://github.com/barryvdh/laravel-ide-helper/pull/1590
* Update README.md by @Mtillmann in https://github.com/barryvdh/laravel-ide-helper/pull/1587
* Rename view var by @barryvdh and @pb30 in https://github.com/barryvdh/laravel-ide-helper/pull/1637 and https://github.com/barryvdh/laravel-ide-helper/pull/1563
* Format IDE helper by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1638
* Add TLDR section, update options by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1639
### New Contributors
* @imzyf made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1631
* @LauJosefsen made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1621
* @hms5232 made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1590
* @Mtillmann made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1587
* @pb30 made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1563
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.3.0...v3.4.0
## v3.3.0 - 2024-12-18
### What's Changed
* Feature: Add Config Option to Enforce Nullable Relationships by @jeramyhing in https://github.com/barryvdh/laravel-ide-helper/pull/1580
* Improve replacement of return type for methods from Query\Builder by @pjio in https://github.com/barryvdh/laravel-ide-helper/pull/1575
* Update CHANGELOG.md, fix typo(s) by @NicholasWilsonDEV in https://github.com/barryvdh/laravel-ide-helper/pull/1613
* Fixed PHP 8.4 deprecation warning by @eusonlito in https://github.com/barryvdh/laravel-ide-helper/pull/1622
* Fix PHP 8.4 deprecations by @JeppeKnockaert in https://github.com/barryvdh/laravel-ide-helper/pull/1618
* Assign $output method parameter to $this->output on Generator by @eusonlito in https://github.com/barryvdh/laravel-ide-helper/pull/1623
### New Contributors
* @jeramyhing made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1580
* @pjio made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1575
* @NicholasWilsonDEV made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1613
* @eusonlito made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1622
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.2.2...v3.3.0
## v3.2.2 - 2024-10-29
### What’s Changed
* fix(pivot): only use unique classes in the pivot union (Fixes #1606) (#1607) @pataar
* docs(pr): remove the changelog checklist item (#1608) @pataar
* Create update-changelog.yaml (#1605) @barryvdh
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.2.1...v3.2.2
## 3.2.1 - 2024-10-28
### What's Changed
* chore: Fix the description of unused option by @KentarouTakeda in https://github.com/barryvdh/laravel-ide-helper/pull/1600
* feat(pivot): add support for multiple pivot types when using the same accessor by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1597
* Add support for `AsCollection::using` and `AsEnumCollection::of` casts by @uno-sw in https://github.com/barryvdh/laravel-ide-helper/pull/1577
* Smarter reset by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1603
* feat: use `numeric` type on fields with `decimal` casts by @ekisu in https://github.com/barryvdh/laravel-ide-helper/pull/1583
### New Contributors
* @uno-sw made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1577
* @ekisu made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1583
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.2.0...v3.2.1
## 3.2.0 - 2024-10-18
### Fixed
- Fix type of hashed model property to `string`
### Changed
- Update view "version" variable name to avoid potential conflicts
- Add support for EloquentBuilder generics introduced in Laravel 11.15.
- Drop support for Laravel versions earlier than 11.15.
### Added
- Introduce `enforce_nullable_relationships` configuration option to control how nullable Eloquent relationships are enforced during static analysis. This provides flexibility for scenarios where application logic ensures data integrity without relying on database constraints. [#1580 / jeramyhing](https://github.com/barryvdh/laravel-ide-helper/pull/1580)
- Add support for AsCollection::using and AsEnumCollection::of casts [#1577 / uno-sw](https://github.com/barryvdh/laravel-ide-helper/pull/1577)
## 3.1.0 - 2024-07-12
### Fixed
- Fix return value of query scopes from parent class [#1366 / sforward](https://github.com/barryvdh/laravel-ide-helper/pull/1366)
- Add static to isBuiltin() check in ide-helper:models [#1541 / bram-pkg](https://github.com/barryvdh/laravel-ide-helper/pull/1541)
- Fix for getSomethingAttribute functions which return a collection with type templating in the phpDoc. [#1567 / stefanScrumble](https://github.com/barryvdh/laravel-ide-helper/pull/1567)
### Added
- Add type to pivot when using a custom pivot class [#1518 / d3v2a](https://github.com/barryvdh/laravel-ide-helper/pull/1518)
- Add support in morphTo relationship for null values [#1547 / matysekmichal](https://github.com/barryvdh/laravel-ide-helper/pull/1547)
- Add support for AsEnumCollection casts [#1557 / Braunson](https://github.com/barryvdh/laravel-ide-helper/pull/1557)
- Support for Attribute class in attributes [#1567 / stefanScrumble](https://github.com/barryvdh/laravel-ide-helper/pull/1567)
## 3.0.0 - 2024-03-01
### Added
- Support for Laravel 11 [#1520 / KentarouTakeda](https://github.com/barryvdh/laravel-ide-helper/pull/1520)
### Changed
- Make `--reset` always keep the text and remove `--smart-reset`. Always skip the classname [#1523 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1523) & [#1525 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1525)
- Use short types (`int` and `bool` instead of `integer` and `boolean`) [#1524 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1524)
### Removed
- Support for Laravel 9 and use of doctrine/dbal [#1512 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1512)
With this functionality gone, a few changes have been made:
- support for custom datatypes has been dropped (config `custom_db_types`) unknown data types default to `string` now and to fix the type, add a proper cast in Eloquent
- You *might* have top-level dependency on doctrine/dbal. This may have been in the past due to ide-helper, we suggest to check if you still need it and remove it otherwise
- Minimum PHP version, due to Laravel 10, is now PHP 8.1
## 2024-02-15, 2.15.1
### Fixed
- Fix final class keyword in wrong position [#1517 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1517)
### Changed
### Added
## 2024-02-14, 2.15.0
### Fixed
- Fix case issue in `ModelsCommand::unsetMethod()` [#1453 / leo108](https://github.com/barryvdh/laravel-ide-helper/pull/1453)
- Fix non-facade classes will result in no autocomplete [#841 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/841)
- Skip swoole, otherwise fatal error [#1477 / TimoFrenzel](https://github.com/barryvdh/laravel-ide-helper/pull/1477)
- Fix vulnerability CVE-2021-43608 [#1392 / allanlaal](https://github.com/barryvdh/laravel-ide-helper/pull/1392)
- Reset foreignKeyConstraintsColumns on model loop start [#1461 / snmatsui](https://github.com/barryvdh/laravel-ide-helper/pull/1461)
- Accept scope & scopes as relation [#1452 / Muetze42](https://github.com/barryvdh/laravel-ide-helper/pull/1452)
- Fix #1300 relation_return_type must take precedence if it is defined [#1394 / menthol](https://github.com/barryvdh/laravel-ide-helper/pull/1394)
### Changed
- Disable inspections of helper files [#1486 / eidng8](https://github.com/barryvdh/laravel-ide-helper/pull/1486)
- Removed support for Laravel 8 and therefore for PHP < 8.0 [#1504 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1504)
### Added
- Add support for enum default arguments using enum cases. [#1464 / d8vjork](https://github.com/barryvdh/laravel-ide-helper/pull/1464)
- Add support for real-time facades in the helper file. [#1455 / filipac](https://github.com/barryvdh/laravel-ide-helper/pull/1455)
- Add support for relations with composite keys. [#1479 / calebdw](https://github.com/barryvdh/laravel-ide-helper/pull/1479)
- Add support for attribute accessors with no backing field or type hinting [#1411 / pindab0ter](https://github.com/barryvdh/laravel-ide-helper/pull/1411).
- Add support for AsCollection and AsArrayObject casts [#1393 / pataar](https://github.com/barryvdh/laravel-ide-helper/pull/1393)
- Reintroduce support for multi-db setups [#1426 / benpoulson](https://github.com/barryvdh/laravel-ide-helper/pull/1426)
- Support the BINARY(...) database field type [#1434 / Sfonxs](https://github.com/barryvdh/laravel-ide-helper/pull/1434)
- Add AllowDynamicProperties Attribute to cooperate with php8.2 deprecation [#1428 / GeoSot](https://github.com/barryvdh/laravel-ide-helper/pull/1428)
## 2024-02-05, 2.14.0
### Changed
- Official support for Lumen has been dropped [#1425 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1425)
- Refactor resolving of null information for custom casted attribute types [#1330 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1330)
### Fixed
- Catch exceptions when loading aliases [#1465 / dongm2ez](https://github.com/barryvdh/laravel-ide-helper/pull/1465)
### Added
- Add support for nikic/php-parser 5 (next to 4) [#1502 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1502)
- Add support for `immutable_date:*` and `immutable_datetime:*` casts. [#1380 / thekonz](https://github.com/barryvdh/laravel-ide-helper/pull/1380)
- Add support for attribute accessors marked as protected. [#1339 / pindab0ter](https://github.com/barryvdh/laravel-ide-helper/pull/1339)
## 2023-02-04, 2.13.0
### Fixed
- Fix return type of methods provided by `SoftDeletes` [#1345 / KentarouTakeda](https://github.com/barryvdh/laravel-ide-helper/pull/1345)
- Handle PHP 8.1 deprecation warnings when passing `null` to `new \ReflectionClass` [#1351 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1351)
- Fix issue where \Eloquent is not included when using write_mixin [#1352 / Jefemy](https://github.com/barryvdh/laravel-ide-helper/pull/1352)
- Fix model factory method arguments for Laravel >= 9 [#1361 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1361)
- Improve return type of mock helper methods in tests [#1405 / bentleyo](https://github.com/barryvdh/laravel-ide-helper/pull/1405)
- Fix Castable class if failed to detect it from return types [#1388 / kwarcu](https://github.com/barryvdh/laravel-ide-helper/pull/1388)
### Added
- Added Laravel 10 support [#1407 / lptn](https://github.com/barryvdh/laravel-ide-helper/pull/1407)
- Add support for custom casts that implement `CastsInboundAttributes` [#1329 / sforward](https://github.com/barryvdh/laravel-ide-helper/pull/1329)
- Add option `use_generics_annotations` for collection type hints [#1298 / tanerkay](https://github.com/barryvdh/laravel-ide-helper/pull/1298)
## 2022-03-06, 2.12.3
### Fixed
- Fix date and datetime handling for attributes that set a serialization format option for the Carbon instance [#1324 / FLeudts](https://github.com/barryvdh/laravel-ide-helper/pull/1324)
- Fix composer conflict with composer/pcre version 2/3. [#1327 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1327)
## 2022-02-08, 2.12.2
### Fixed
- Remove composer dependency, use copy of ClassMapGenerator [#1313 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1313)
## 2022-01-24, 2.12.1
### Fixed
- Properly handle `Castable`s without return type. [#1306 / binotaliu](https://github.com/barryvdh/laravel-ide-helper/pull/1306)
## 2022-01-23, 2.12.0
### Added
- Add support for custom casts that using `Castable` [#1287 / binotaliu](https://github.com/barryvdh/laravel-ide-helper/pull/1287)
- Added Laravel 9 support [#1297 / rcerljenko](https://github.com/barryvdh/laravel-ide-helper/pull/1297)
- Added option `additional_relation_return_types` for custom relations that don't fit the typical naming scheme
## 2022-01-03, 2.11.0
### Added
- Add support for Laravel 8.77 Attributes [#1289 / SimonJnsson](https://github.com/barryvdh/laravel-ide-helper/pull/1289)
- Add support for cast types `decimal:*`, `encrypted:*`, `immutable_date`, `immutable_datetime`, `custom_datetime`, and `immutable_custom_datetime` [#1262 / miken32](https://github.com/barryvdh/laravel-ide-helper/pull/1262)
- Add support of variadic parameters in `ide-helper:models` [#1234 / shaffe-fr](https://github.com/barryvdh/laravel-ide-helper/pull/1234)
- Add support of custom casts without properties [#1267 / sparclex](https://github.com/barryvdh/laravel-ide-helper/pull/1267)
### Fixed
- Fix recursively searching for `HasFactory` and `Macroable` traits [#1216 / daniel-de-wit](https://github.com/barryvdh/laravel-ide-helper/pull/1216)
- Use platformName to determine db type when casting boolean types [#1212 / stockalexander](https://github.com/barryvdh/laravel-ide-helper/pull/1212)
### Changed
- Move default models helper filename to config [#1241 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1241)
## 2021-06-18, 2.10.1
### Added
- Added Type registration according to [Custom Mapping Types documentation](https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#custom-mapping-types) [#1228 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1241)
### Fixed
- Fixing issue where configured custom_db_types could cause a DBAL exception to be thrown while running `ide-helper:models` [#1228 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1241)
## 2021-04-09, 2.10.0
### Added
- Allowing Methods to be set or unset in ModelHooks [#1198 / jenga201](https://github.com/barryvdh/laravel-ide-helper/pull/1198)
Note: the visibility of `\Barryvdh\LaravelIdeHelper\Console\ModelsCommand::setMethod` has been changed to **public**!
### Fixed
- Fixing issue where incorrect autoloader unregistered [#1210 / tezhm](https://github.com/barryvdh/laravel-ide-helper/pull/1210)
## 2021-04-02, 2.9.3
### Fixed
- Support both customized namespace factories as well as default resolvable ones [#1201 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1201)
## 2021-04-01, 2.9.2
### Added
- Model hooks for adding custom information from external sources to model classes through the ModelsCommand [#945 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/945)
### Fixed
- Fix ide-helper:models exception if model doesn't have factory [#1196 / ahmed-aliraqi](https://github.com/barryvdh/laravel-ide-helper/pull/1196)
- Running tests triggering post_migrate hooks [#1193 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1193)
- Array_merge error when config is cached prior to package install [#1184 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1184)
## 2021-03-15, 2.9.1
### Added
- Generate PHPDoc for Laravel 8.x factories [#1074 / ahmed-aliraqi](https://github.com/barryvdh/laravel-ide-helper/pull/1074)
- Add a comment to a property like table columns [#1168 / biiiiiigmonster](https://github.com/barryvdh/laravel-ide-helper/pull/1168)
- Added `post_migrate` hook to run commands after a migration [#1163 / netpok](https://github.com/barryvdh/laravel-ide-helper/pull/1163)
- Allow for PhpDoc for macros with union types [#1148 / riesjart](https://github.com/barryvdh/laravel-ide-helper/pull/1148)
### Fixed
- Error when generating helper for invokable classes [#1124 / standaniels](https://github.com/barryvdh/laravel-ide-helper/pull/1124)
- Fix broken ReflectionUnionTypes [#1132 / def-studio](https://github.com/barryvdh/laravel-ide-helper/pull/1132)
- Relative class names are not converted to fully-qualified class names [#1005 / SavKS](https://github.com/barryvdh/laravel-ide-helper/pull/1005)
## 2020-12-30, 2.9.0
### Changed
- Dropped support for Laravel 6 and Laravel 7, as well as support for PHP 7.2 and added support for doctrine/dbal:^3 [#1114 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1114)
### Fixed
- `Macro::initPhpDoc()` will save original docblock if present [#1116 / LastDragon-ru](https://github.com/barryvdh/laravel-ide-helper/pull/1116)
- `Alias` will grab macros from `\Illuminate\Database\Eloquent\Builder` too [#1118 / LastDragon-ru](https://github.com/barryvdh/laravel-ide-helper/pull/1118)
## 2020-12-08, 2.8.2
### Added
- Fix phpdoc generate for custom cast with parameter [#986 / artelkr](https://github.com/barryvdh/laravel-ide-helper/pull/986)
- Created a possibility to add custom relation type [#987 / efinder2](https://github.com/barryvdh/laravel-ide-helper/pull/987)
- Added `@see` with macro/mixin definition location to PhpDoc [#1054 / riesjart](https://github.com/barryvdh/laravel-ide-helper/pull/1054)
- Initial compatibility for PHP8 [#1106 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1106)
### Changed
- Implement DeferrableProvider [#914 / kon-shou](https://github.com/barryvdh/laravel-ide-helper/pull/914)
### Fixed
- Compatibility with Lumen [#1043 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1043)
- Allow model_locations to have glob patterns [#1059 / saackearl](https://github.com/barryvdh/laravel-ide-helper/pull/1059)
- Error when generating helper for macroable classes which are not facades and contain a "fake" method [#1066 / domkrm] (https://github.com/barryvdh/laravel-ide-helper/pull/1066)
- Casts with a return type of `static` or `$this` now resolve to an instance of the cast [#1103 / riesjart](https://github.com/barryvdh/laravel-ide-helper/pull/1103)
### Removed
- Removed format and broken generateJsonHelper [#1053 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1053)
## 2020-09-07, 2.8.1
### Added
- Support Laravel 8 [#1022 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1022)
- Add option to force usage of FQN [#1031 / edvordo](https://github.com/barryvdh/laravel-ide-helper/pull/1031)
- Add support for macros of all macroable classes [#1006 / domkrm](https://github.com/barryvdh/laravel-ide-helper/pull/1006)
## 2020-08-11, 2.8.0
### Added
- Add static return type to builder methods [#924 / dmason30](https://github.com/barryvdh/laravel-ide-helper/pull/924)
- Add `optional` to meta generator for PhpStorm [#932 / halaei](https://github.com/barryvdh/laravel-ide-helper/pull/932)
- Decimal columns as string in Models [#948 / fgibaux](https://github.com/barryvdh/laravel-ide-helper/pull/948)
- Simplify full namespaces for already included resources [#954 / LANGERGabriel](https://github.com/barryvdh/laravel-ide-helper/pull/954)
- Make writing relation count properties optional [#969 / AegirLeet](https://github.com/barryvdh/laravel-ide-helper/pull/969)
- Add more methods able to resolve container instances [#996 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/996)
### Fixed
- Test `auth` is bound before detect Auth driver [#946 / zhwei](https://github.com/barryvdh/laravel-ide-helper/pull/946)
- Fix inline doc-block for final models [#944 / Gummibeer](https://github.com/barryvdh/laravel-ide-helper/pull/955)
## 2020-04-22, 2.7.0
### Added
- Add `ignored_models` as config option [#890 / pataar](https://github.com/barryvdh/laravel-ide-helper/pull/890)
- Infer return type from reflection if no phpdoc given [#906 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/906)
- Add custom collection support for get and all methods [#903 / dmason30](https://github.com/barryvdh/laravel-ide-helper/pull/903)
- if a model implements interfaces, include them in the stub [#920 / mr-feek](https://github.com/barryvdh/laravel-ide-helper/pull/920)
- Generate noinspections PHPStorm tags [#905 / mzglinski](https://github.com/barryvdh/laravel-ide-helper/pull/905)
- Added support for Laravel 7 custom casts [#913 / belamov](https://github.com/barryvdh/laravel-ide-helper/pull/913)
- Ability to use patterns for model_locations [#921 / 4n70w4](https://github.com/barryvdh/laravel-ide-helper/pull/921)
### Fixed
- MorphToMany relations with query not working [#894 / UksusoFF](https://github.com/barryvdh/laravel-ide-helper/pull/894)
- Fix camelCase duplicated properties generator [#881 / bop10](https://github.com/barryvdh/laravel-ide-helper/pull/881)
- Prevent generation of invalid code for certain parameter default values [#901 / loilo](https://github.com/barryvdh/laravel-ide-helper/pull/901)
- Make hasOne and morphOne nullable [#864 / leo108](https://github.com/barryvdh/laravel-ide-helper/pull/864)
- Remove unnecessary and wrong definition of SoftDelete methods [#918 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/918)
- Unregister meta command custom autoloader when it is no longer needed [#919 / mr-feek](https://github.com/barryvdh/laravel-ide-helper/pull/919)
## 2020-02-25, 2.6.7
### Added
- Support for Laravel 7 [commit by barryvdh](https://github.com/barryvdh/laravel-ide-helper/commit/edd69c5e0508972c81f1f7173236de2459c45814)
## 2019-12-02, 2.6.6
### Added
- Add splat operator (...) support [#860 / ngmy](https://github.com/barryvdh/laravel-ide-helper/pull/860)
- Add support for custom date class via Date::use() [#859 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/859)
### Fixed
- Prevent undefined property errors [#877 / matt-allan](https://github.com/barryvdh/laravel-ide-helper/pull/877)
---
Missing an older changelog? Feel free to submit a PR!
================================================
FILE: LICENSE.md
================================================
# The MIT License (MIT)
Copyright (c) Barry vd. Heuvel <barryvdh@gmail.com>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.
================================================
FILE: README.md
================================================
# IDE Helper Generator for Laravel
[](https://github.com/barryvdh/laravel-ide-helper/actions)
[](http://choosealicense.com/licenses/mit/)
[](https://packagist.org/packages/barryvdh/laravel-ide-helper)
[](https://packagist.org/packages/barryvdh/laravel-ide-helper)
[](https://fruitcake.nl/)
**Complete PHPDocs, directly from the source**
This package generates helper files that enable your IDE to provide accurate autocompletion.
Generation is done based on the files in your project, so they are always up-to-date.
The 3.x branch supports Laravel 10 and later. For older version, use the 2.x releases.
- [Installation](#installation)
- [Usage](#usage)
- [Automatic PHPDoc generation for Laravel Facades](#automatic-phpdoc-generation-for-laravel-facades)
- [Automatic PHPDocs for models](#automatic-phpdocs-for-models)
- [Model Directories](#model-directories)
- [Ignore Models](#ignore-models)
- [Model Hooks](#model-hooks)
- [Automatic PHPDocs generation for Laravel Fluent methods](#automatic-phpdocs-generation-for-laravel-fluent-methods)
- [Auto-completion for factory builders](#auto-completion-for-factory-builders)
- [PhpStorm Meta for Container instances](#phpstorm-meta-for-container-instances)
- [License](#license)
## Installation
Require this package with composer using the following command:
```bash
composer require --dev barryvdh/laravel-ide-helper
```
## Usage
### TL;DR
Run this to generate autocompletion for Facades. This creates _ide_helper.php
```
php artisan ide-helper:generate
```
Run this to add phpdocs for your models. Add -RW to Reset existing phpdocs and Write to the models directly.
```
php artisan ide-helper:models -RW
```
If you don't want the full _ide_helper.php file, you can run add `--write-eloquent-helper` to the model command to generate small version, which is required for the `@mixin \Eloquent` to be able to add the QueryBuilder methods.
If you don't want to add all the phpdocs to your Models directly, you can use `--nowrite` to create a separate file. The `--write-mixin` option can be used to only add a `@mixin` to your models, but add the generated phpdocs in a separate file. This avoids having the results marked as duplicate.
_Check out [this Laracasts video](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/15) for a quick introduction/explanation!_
- `php artisan ide-helper:generate` - [PHPDoc generation for Laravel Facades ](#automatic-phpdoc-generation-for-laravel-facades)
- `php artisan ide-helper:models` - [PHPDocs for models](#automatic-phpdocs-for-models)
- `php artisan ide-helper:meta` - [PhpStorm Meta file](#phpstorm-meta-for-container-instances)
> Note: You do need CodeComplice for Sublime Text: https://github.com/spectacles/CodeComplice
### Automatic PHPDoc generation for Laravel Facades
You can now re-generate the docs yourself (for future updates)
```bash
php artisan ide-helper:generate
```
This will generate the file `_ide_helper.php` which is expected to be additionally parsed by your IDE for autocomplete. You can use the config `filename` to change its name.
You can configure your `composer.json` to do this each time you update your dependencies:
```js
"scripts": {
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"@php artisan ide-helper:generate",
"@php artisan ide-helper:meta"
]
},
```
You can also publish the config file to change implementations (ie. interface to specific class) or set defaults for `--helpers`.
```bash
php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config
```
The generator tries to identify the real class, but if it cannot be found, you can define it in the config file.
Some classes need a working database connection. If you do not have a default working connection, some facades will not be included.
You can use an in-memory SQLite driver by adding the `-M` option.
If you use [real-time facades](https://laravel.com/docs/master/facades#real-time-facades) in your app, those will also be included in the generated file using a `@mixin` annotation and extending the original class underneath the facade.
> **Note**: this feature uses the generated real-time facades files in the `storage/framework/cache` folder. Those files are generated on-demand as you use the real-time facade, so if the framework has not generated that first, it will not be included in the helper file. Run the route/command/code first and then regenerate the helper file and this time the real-time facade will be included in it.
You can choose to include helper files. This is not enabled by default, but you can override it with the `--helpers (-H)` option.
The `Illuminate/Support/helpers.php` is already set up, but you can add/remove your own files in the config file.
### Automatic PHPDoc generation for macros and mixins
This package can generate PHPDocs for macros and mixins which will be added to the `_ide_helper.php` file.
But this only works if you use type hinting when declaring a macro.
```php
Str::macro('concat', function(string $str1, string $str2) : string {
return $str1 . $str2;
});
```
### Automatic PHPDocs for models
If you don't want to write your properties yourself, you can use the command `php artisan ide-helper:models` to generate
PHPDocs, based on table columns, relations and getters/setters.
> Note: this command requires a working database connection to introspect the table of each model
By default, you are asked to overwrite or write to a separate file (`_ide_helper_models.php`).
You can write the comments directly to your Model file, using the `--write (-W)` option, or
force to not write with `--nowrite (-N)`.
Alternatively using the `--write-mixin (-M)` option will only add a mixin tag to your Model file,
writing the rest in (`_ide_helper_models.php`).
The class name will be different from the model, avoiding the IDE duplicate annoyance.
> Please make sure to back up your models, before writing the info.
> You need the _ide_helper.php file to add the QueryBuilder methods. You can add --write-eloquent-helper/-E to generate a minimal version. If this file does not exist, you will be prompted for it.
Writing to the models should keep the existing comments and only append new properties/methods. It will not update changed properties/methods.
With the `--reset (-R)` option, the whole existing PHPDoc is replaced, including any comments that have been made.
```bash
php artisan ide-helper:models "App\Models\Post"
```
```php
/**
* App\Models\Post
*
* @property integer $id
* @property integer $author_id
* @property string $title
* @property string $text
* @property \Illuminate\Support\Carbon $created_at
* @property \Illuminate\Support\Carbon $updated_at
* @property-read \User $author
* @property-read \Illuminate\Database\Eloquent\Collection|\Comment[] $comments
* @method static \Illuminate\Database\Eloquent\Builder<static>|\App\Models\Post newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|\App\Models\Post newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|\App\Models\Post query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|\App\Models\Post whereTitle($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|\App\Models\Post forAuthors(\User ...$authors)
* …
*/
```
With the `--write-mixin (-M)` option
```php
/**
* …
* @mixin IdeHelperPost
*/
```
#### Model Directories
By default, models in `app/models` are scanned. The optional argument tells what models to use (also outside app/models).
```bash
php artisan ide-helper:models "App\Models\Post" "App\Models\User"
```
You can also scan a different directory, using the `--dir` option (relative from the base path):
```bash
php artisan ide-helper:models --dir="path/to/models" --dir="app/src/Model"
```
You can publish the config file (`php artisan vendor:publish`) and set the default directories.
#### Ignore Models
Models can be ignored using the `--ignore (-I)` option
```bash
php artisan ide-helper:models --ignore="App\Models\Post,App\Models\User"
```
Or can be ignored by setting the `ignored_models` config
```php
'ignored_models' => [
App\Post::class,
Api\User::class
],
```
#### Magic `where*` methods
Eloquent allows calling `where<Attribute>` on your models, e.g. `Post::whereTitle(…)` and automatically translates this to e.g. `Post::where('title', '=', '…')`.
If for some reason it's undesired to have them generated (one for each column), you can disable this via config `write_model_magic_where` and setting it to `false`.
#### Magic `*_count` and `*_exists` properties
You may use the [`::withCount`](https://laravel.com/docs/master/eloquent-relationships#counting-related-models) and [`::withExists`](https://laravel.com/docs/master/eloquent-relationships#other-aggregate-functions) methods to count the number results from a relationship without actually loading them. Those results are then placed in attributes following the `<columnname>_count` and `<columnname>_exists` convention.
By default, these attributes are generated in the phpdoc. You can turn them off by setting the config `write_model_relation_count_properties` and `write_model_relation_exists_properties` to `false`.
#### Generics annotations
Laravel 9 introduced generics annotations in DocBlocks for collections. PhpStorm 2022.3 and above support the use of generics annotations within `@property` and `@property-read` declarations in DocBlocks, e.g. `Collection<User>` instead of `Collection|User[]`.
These can be disabled by setting the config `use_generics_annotations` to `false`.
#### Support `@comment` based on DocBlock
In order to better support IDEs, relations and getters/setters can also add a comment to a property like table columns. Therefore a custom docblock `@comment` is used:
```php
class Users extends Model
{
/**
* @comment Get User's full name
*
* @return string
*/
public function getFullNameAttribute(): string
{
return $this->first_name . ' ' .$this->last_name ;
}
}
// => after generate models
/**
* App\Models\Users
*
* @property-read string $full_name Get User's full name
* …
*/
```
#### Dedicated Eloquent Builder methods
A new method to the eloquent models was added called `newEloquentBuilder` [Reference](https://timacdonald.me/dedicated-eloquent-model-query-builders/) where we can
add support for creating a new dedicated class instead of using local scopes in the model itself.
If for some reason it's undesired to have them generated (one for each column), you can disable this via config `write_model_external_builder_methods` and setting it to `false`.
#### Custom Relationship Types
If you are using relationships not built into Laravel you will need to specify the name and returning class in the config to get proper generation.
```php
'additional_relation_types' => [
'externalHasMany' => \My\Package\externalHasMany::class
],
```
Found relationships will typically generate a return value based on the name of the relationship.
If your custom relationships don't follow this traditional naming scheme you can define its return type manually. The available options are `many` and `morphTo`.
```php
'additional_relation_return_types' => [
'externalHasMultiple' => 'many'
],
```
#### Model Hooks
If you need additional information on your model from sources that are not handled by default, you can hook in to the
generation process with model hooks to add extra information on the fly.
Simply create a class that implements `ModelHookInterface` and add it to the `model_hooks` array in the config:
```php
'model_hooks' => [
MyCustomHook::class,
],
```
The `run` method will be called during generation for every model and receives the current running `ModelsCommand` and the current `Model`, e.g.:
```php
class MyCustomHook implements ModelHookInterface
{
public function run(ModelsCommand $command, Model $model): void
{
if (! $model instanceof MyModel) {
return;
}
$command->setProperty('custom', 'string', true, false, 'My custom property');
$command->unsetMethod('method');
$command->setMethod('method', $command->getMethodType($model, '\Some\Class'), ['$param']);
}
}
```
```php
/**
* MyModel
*
* @property integer $id
* @property-read string $custom
```
### Automatic PHPDocs generation for Laravel Fluent methods
If you need PHPDocs support for Fluent methods in migration, for example
```php
$table->string("somestring")->nullable()->index();
```
After publishing vendor, simply change the `include_fluent` line in your `config/ide-helper.php` file into:
```php
'include_fluent' => true,
```
Then run `php artisan ide-helper:generate`, you will now see all Fluent methods recognized by your IDE.
### Auto-completion for factory builders
If you would like the `factory()->create()` and `factory()->make()` methods to return the correct model class,
you can enable custom factory builders with the `include_factory_builders` line in your `config/ide-helper.php` file.
Deprecated for Laravel 8 or latest.
```php
'include_factory_builders' => true,
```
For this to work, you must also publish the PhpStorm Meta file (see below).
## PhpStorm Meta for Container instances
It's possible to generate a PhpStorm meta file to [add support for factory design pattern](https://www.jetbrains.com/help/phpstorm/ide-advanced-metadata.html).
For Laravel, this means we can make PhpStorm understand what kind of object we are resolving from the IoC Container.
For example, `events` will return an `Illuminate\Events\Dispatcher` object,
so with the meta file you can call `app('events')` and it will autocomplete the Dispatcher methods.
```bash
php artisan ide-helper:meta
```
```php
app('events')->fire();
\App::make('events')->fire();
/** @var \Illuminate\Foundation\Application $app */
$app->make('events')->fire();
// When the key is not found, it uses the argument as class name
app('App\SomeClass');
// Also works with
app(App\SomeClass::class);
```
> Note: You might need to restart PhpStorm and make sure `.phpstorm.meta.php` is indexed.
> Note: When you receive a FatalException: class not found, check your config
> (for example, remove S3 as cloud driver when you don't have S3 configured. Remove Redis ServiceProvider when you don't use it).
You can change the generated filename via the config `meta_filename`. This can be useful for cases where you want to take advantage of PhpStorm's support of the _directory_ `.phpstorm.meta.php/`: all files placed there are parsed, should you want to provide additional files to PhpStorm.
## License
The Laravel IDE Helper Generator is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)
================================================
FILE: composer.json
================================================
{
"name": "barryvdh/laravel-ide-helper",
"description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.",
"license": "MIT",
"keywords": [
"laravel",
"autocomplete",
"ide",
"helper",
"phpstorm",
"netbeans",
"sublime",
"codeintel",
"phpdoc",
"dev"
],
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"require": {
"php": "^8.2",
"ext-json": "*",
"barryvdh/reflection-docblock": "^2.4",
"composer/class-map-generator": "^1.0",
"illuminate/console": "^11.15 || ^12 || ^13.0",
"illuminate/database": "^11.15 || ^12 || ^13.0",
"illuminate/filesystem": "^11.15 || ^12 || ^13.0",
"illuminate/support": "^11.15 || ^12 || ^13.0"
},
"require-dev": {
"ext-pdo_sqlite": "*",
"friendsofphp/php-cs-fixer": "^3",
"illuminate/config": "^11.15 || ^12 || ^13.0",
"illuminate/view": "^11.15 || ^12 || ^13.0",
"larastan/larastan": "^3.1",
"mockery/mockery": "^1.4",
"orchestra/testbench": "^9.2 || ^10 || ^11.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^10.5 || ^11.5.3 || ^12.5.12",
"spatie/phpunit-snapshot-assertions": "^4 || ^5",
"vlucas/phpdotenv": "^5"
},
"suggest": {
"illuminate/events": "Required for automatic helper generation (^6|^7|^8|^9|^10|^11)."
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Barryvdh\\LaravelIdeHelper\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Barryvdh\\LaravelIdeHelper\\Tests\\": "tests"
}
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
},
"laravel": {
"providers": [
"Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider"
]
}
},
"scripts": {
"analyze": "phpstan",
"analyze-set-baseline": "phpstan --generate-baseline",
"check-style": [
"php-cs-fixer fix --diff --diff-format=udiff --dry-run",
"php-cs-fixer fix --diff --diff-format=udiff --dry-run --config=.php_cs.tests.php"
],
"fix-style": [
"php-cs-fixer fix",
"php-cs-fixer fix --config=.php-cs-fixer.tests.php"
],
"test": "phpunit",
"test-ci": "phpunit",
"test-regenerate": "phpunit -d --update-snapshots"
}
}
================================================
FILE: config/ide-helper.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Filename
|--------------------------------------------------------------------------
|
| The default filename.
|
*/
'filename' => '_ide_helper.php',
/*
|--------------------------------------------------------------------------
| Models filename
|--------------------------------------------------------------------------
|
| The default filename for the models helper file.
|
*/
'models_filename' => '_ide_helper_models.php',
/*
|--------------------------------------------------------------------------
| PhpStorm meta filename
|--------------------------------------------------------------------------
|
| PhpStorm also supports the directory `.phpstorm.meta.php/` with arbitrary
| files in it, should you need additional files for your project; e.g.
| `.phpstorm.meta.php/laravel_ide_Helper.php'.
|
*/
'meta_filename' => '.phpstorm.meta.php',
/*
|--------------------------------------------------------------------------
| Fluent helpers
|--------------------------------------------------------------------------
|
| Set to true to generate commonly used Fluent methods.
|
*/
'include_fluent' => false,
/*
|--------------------------------------------------------------------------
| Write model query methods
|--------------------------------------------------------------------------
|
| Set to false to disable generated docs for the 'query()', 'newQuery()' and 'newModelQuery()' methods.
|
*/
'write_query_methods' => true,
/*
|--------------------------------------------------------------------------
| Write model magic methods
|--------------------------------------------------------------------------
|
| Set to false to disable write magic methods of model.
|
*/
'write_model_magic_where' => true,
/*
|--------------------------------------------------------------------------
| Write model external Eloquent builder methods
|--------------------------------------------------------------------------
|
| Set to false to disable write external Eloquent builder methods.
|
*/
'write_model_external_builder_methods' => true,
/*
|--------------------------------------------------------------------------
| Write model relation count and exists properties
|--------------------------------------------------------------------------
|
| Set to false to disable writing of relation count and exists properties
| to model DocBlocks.
|
*/
'write_model_relation_count_properties' => true,
'write_model_relation_exists_properties' => false,
/*
|--------------------------------------------------------------------------
| Write Eloquent model mixins
|--------------------------------------------------------------------------
|
| This will add the necessary DocBlock mixins to the model class
| contained in the Laravel framework. This helps the IDE with
| auto-completion.
|
| Please be aware that this setting changes a file within the /vendor directory.
|
*/
'write_eloquent_model_mixins' => false,
/*
|--------------------------------------------------------------------------
| Helper files to include
|--------------------------------------------------------------------------
|
| Include helper files. By default not included, but can be toggled with the
| -- helpers (-H) option. Extra helper files can be included.
|
*/
'include_helpers' => false,
'helper_files' => [
base_path() . '/vendor/laravel/framework/src/Illuminate/Support/helpers.php',
base_path() . '/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php',
],
/*
|--------------------------------------------------------------------------
| Model locations to include
|--------------------------------------------------------------------------
|
| Define in which directories the ide-helper:models command should look
| for models.
|
| glob patterns are supported to easier reach models in sub-directories,
| e.g. `app/Services/* /Models` (without the space).
|
*/
'model_locations' => [
'app',
],
/*
|--------------------------------------------------------------------------
| Models to ignore
|--------------------------------------------------------------------------
|
| Define which models should be ignored.
|
*/
'ignored_models' => [
// App\MyModel::class,
],
/*
|--------------------------------------------------------------------------
| Models hooks
|--------------------------------------------------------------------------
|
| Define which hook classes you want to run for models to add custom information.
|
| Hooks should implement Barryvdh\LaravelIdeHelper\Contracts\ModelHookInterface.
|
*/
'model_hooks' => [
// App\Support\IdeHelper\MyModelHook::class
],
/*
|--------------------------------------------------------------------------
| Extra classes
|--------------------------------------------------------------------------
|
| These implementations are not really extended, but called with magic functions.
|
*/
'extra' => [
'Eloquent' => ['Illuminate\Database\Eloquent\Builder', 'Illuminate\Database\Query\Builder'],
'Session' => ['Illuminate\Session\Store'],
],
'magic' => [],
/*
|--------------------------------------------------------------------------
| Interface implementations
|--------------------------------------------------------------------------
|
| These interfaces will be replaced with the implementing class. Some interfaces
| are detected by the helpers, others can be listed below.
|
*/
'interfaces' => [
// App\MyInterface::class => App\MyImplementation::class,
],
/*
|--------------------------------------------------------------------------
| Support for camel cased models
|--------------------------------------------------------------------------
|
| There are some Laravel packages (such as Eloquence) that allow for accessing
| Eloquent model properties via camel case, instead of snake case.
|
| Enabling this option will support these packages by saving all model
| properties as camel case, instead of snake case.
|
| For example, normally you would see this:
|
| * @property \Illuminate\Support\Carbon $created_at
| * @property \Illuminate\Support\Carbon $updated_at
|
| With this enabled, the properties will be this:
|
| * @property \Illuminate\Support\Carbon $createdAt
| * @property \Illuminate\Support\Carbon $updatedAt
|
| Note, it is currently an all-or-nothing option.
|
*/
'model_camel_case_properties' => false,
/*
|--------------------------------------------------------------------------
| Property casts
|--------------------------------------------------------------------------
|
| Cast the given "real type" to the given "type".
|
*/
'type_overrides' => [
'integer' => 'int',
'boolean' => 'bool',
],
/*
|--------------------------------------------------------------------------
| Include DocBlocks from classes
|--------------------------------------------------------------------------
|
| Include DocBlocks from classes to allow additional code inspection for
| magic methods and properties.
|
*/
'include_class_docblocks' => false,
/*
|--------------------------------------------------------------------------
| Force FQN usage
|--------------------------------------------------------------------------
|
| Use the fully qualified (class) name in DocBlocks,
| even if the class exists in the same namespace
| or there is an import (use className) of the class.
|
*/
'force_fqn' => false,
/*
|--------------------------------------------------------------------------
| Use generics syntax
|--------------------------------------------------------------------------
|
| Use generics syntax within DocBlocks,
| e.g. `Collection<User>` instead of `Collection|User[]`.
|
*/
'use_generics_annotations' => true,
/*
|--------------------------------------------------------------------------
| Default return types for macros
|--------------------------------------------------------------------------
|
| Define default return types for macros without explicit return types.
| e.g. `\Illuminate\Database\Query\Builder::class => 'static'`,
| `\Illuminate\Support\Str::class => 'string'`
|
*/
'macro_default_return_types' => [
Illuminate\Http\Client\Factory::class => Illuminate\Http\Client\PendingRequest::class,
],
/*
|--------------------------------------------------------------------------
| Additional relation types
|--------------------------------------------------------------------------
|
| Sometimes it's needed to create custom relation types. The key of the array
| is the relationship method name. The value of the array is the fully-qualified
| class name of the relationship, e.g. `'relationName' => RelationShipClass::class`.
|
*/
'additional_relation_types' => [],
/*
|--------------------------------------------------------------------------
| Additional relation return types
|--------------------------------------------------------------------------
|
| When using custom relation types its possible for the class name to not contain
| the proper return type of the relation. The key of the array is the relationship
| method name. The value of the array is the return type of the relation ('many'
| or 'morphTo').
| e.g. `'relationName' => 'many'`.
|
*/
'additional_relation_return_types' => [],
/*
|--------------------------------------------------------------------------
| Enforce nullable Eloquent relationships on not null columns
|--------------------------------------------------------------------------
|
| When set to true (default), this option enforces nullable Eloquent relationships.
| However, in cases where the application logic ensures the presence of related
| records it may be desirable to set this option to false to avoid unwanted null warnings.
|
| Default: true
| A not null column with no foreign key constraint will have a "nullable" relationship.
| * @property int $not_null_column_with_no_foreign_key_constraint
| * @property-read BelongsToVariation|null $notNullColumnWithNoForeignKeyConstraint
|
| Option: false
| A not null column with no foreign key constraint will have a "not nullable" relationship.
| * @property int $not_null_column_with_no_foreign_key_constraint
| * @property-read BelongsToVariation $notNullColumnWithNoForeignKeyConstraint
|
*/
'enforce_nullable_relationships' => true,
/*
|--------------------------------------------------------------------------
| Make soft deletable relations nullable
|--------------------------------------------------------------------------
|
| When set to true (default), relationships to models using SoftDeletes trait
| will be marked as nullable. This is because soft-deleted records are excluded
| from queries by default, meaning even non-nullable foreign keys can return
| null when the related model is soft-deleted.
|
| Default: true
| A relationship to a soft-deletable model will include |null in the type:
| * @property-read Team|null $team
|
| Option: false
| A relationship to a soft-deletable model will NOT include |null (unless
| nullable for other reasons such as nullable foreign key column):
| * @property-read Team $team
|
*/
'soft_deletes_force_nullable' => true,
/*
|--------------------------------------------------------------------------
| Run artisan commands after migrations to generate model helpers
|--------------------------------------------------------------------------
|
| The specified commands should run after migrations are finished running.
|
*/
'post_migrate' => [
// 'ide-helper:models --nowrite',
],
];
================================================
FILE: php-templates/LICENSE.md
================================================
The MIT License (MIT)
Copyright (c) Taylor Otwell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: php-templates/README.md
================================================
The templates here are based on the official VS Code extension by Laravel https://github.com/laravel/vs-code-extension
Modifications:
- return instead of echo
- do not serialize to JSON
================================================
FILE: php-templates/auth.php
================================================
<?php
return collect(Illuminate\Support\Facades\Gate::abilities())
->map(function ($policy, $key) {
$reflection = new ReflectionFunction($policy);
$policyClass = null;
$closureThis = $reflection->getClosureThis();
if ($closureThis && get_class($closureThis) === Illuminate\Auth\Access\Gate::class) {
$vars = $reflection->getClosureUsedVariables();
if (isset($vars['callback'])) {
[$policyClass, $method] = explode('@', $vars['callback']);
$reflection = new ReflectionMethod($policyClass, $method);
}
}
return [
'key' => $key,
'uri' => $reflection->getFileName(),
'policy_class' => $policyClass,
'lineNumber' => $reflection->getStartLine(),
];
})
->merge(
collect(Illuminate\Support\Facades\Gate::policies())->flatMap(function ($policy, $model) {
$methods = (new ReflectionClass($policy))->getMethods();
return collect($methods)->map(function (ReflectionMethod $method) use ($policy) {
return [
'key' => $method->getName(),
'uri' => $method->getFileName(),
'policy_class' => $policy,
'lineNumber' => $method->getStartLine(),
];
})->filter(function ($ability) {
return !in_array($ability['key'], ['allow', 'deny']);
});
}),
)
->values()
->groupBy('key');
================================================
FILE: php-templates/configs.php
================================================
<?php
$local = collect(glob(config_path('/*.php')))
->merge(glob(config_path('**/*.php')))
->map(fn ($path) => [
(string) Illuminate\Support\Str::of($path)
->replace([config_path('/'), '.php'], '')
->replace('/', '.'),
$path,
]);
$vendor = collect(glob(base_path('vendor/**/**/config/*.php')))->map(fn (
$path
) => [
(string) Illuminate\Support\Str::of($path)
->afterLast('/config/')
->replace('.php', '')
->replace('/', '.'),
$path,
]);
$configPaths = $local
->merge($vendor)
->groupBy(0)
->map(fn ($items) => $items->pluck(1));
$cachedContents = [];
$cachedParsed = [];
function vsCodeGetConfigValue($value, $key, $configPaths)
{
$parts = explode('.', $key);
$toFind = $key;
$found = null;
while (count($parts) > 0) {
array_pop($parts);
$toFind = implode('.', $parts);
if ($configPaths->has($toFind)) {
$found = $toFind;
break;
}
}
if ($found === null) {
return null;
}
$file = null;
$line = null;
if ($found === $key) {
$file = $configPaths->get($found)[0];
} else {
foreach ($configPaths->get($found) as $path) {
$cachedContents[$path] ??= file_get_contents($path);
$cachedParsed[$path] ??= token_get_all($cachedContents[$path]);
$keysToFind = Illuminate\Support\Str::of($key)
->replaceFirst($found, '')
->ltrim('.')
->explode('.');
if (is_numeric($keysToFind->last())) {
$index = $keysToFind->pop();
if ($index !== '0') {
return null;
}
$key = collect(explode('.', $key));
$key->pop();
$key = $key->implode('.');
$value = [];
}
$nextKey = $keysToFind->shift();
$expectedDepth = 1;
$depth = 0;
foreach ($cachedParsed[$path] as $token) {
if ($token === '[') {
$depth++;
}
if ($token === ']') {
$depth--;
}
if (!is_array($token)) {
continue;
}
$str = trim($token[1], '"\'');
if (
$str === $nextKey &&
$depth === $expectedDepth &&
$token[0] === T_CONSTANT_ENCAPSED_STRING
) {
$nextKey = $keysToFind->shift();
$expectedDepth++;
if ($nextKey === null) {
$file = $path;
$line = $token[2];
break;
}
}
}
if ($file) {
break;
}
}
}
return [
'name' => $key,
'value' => $value,
'file' => $file === null ? null : str_replace(base_path('/'), '', $file),
'line' => $line,
];
}
return collect(Illuminate\Support\Arr::dot(config()->all()))
->map(fn ($value, $key) => vsCodeGetConfigValue($value, $key, $configPaths))
->filter()
->values();
================================================
FILE: php-templates/middleware.php
================================================
<?php
return collect(app("Illuminate\Contracts\Http\Kernel")->getMiddlewareGroups())
->merge(app("Illuminate\Contracts\Http\Kernel")->getRouteMiddleware())
->map(function ($middleware, $key) {
$result = [
'class' => null,
'uri' => null,
'startLine' => null,
'parameters' => null,
'groups' => [],
];
if (is_array($middleware)) {
$result['groups'] = collect($middleware)->map(function ($m) {
if (!class_exists($m)) {
return [
'class' => $m,
'uri' => null,
'startLine' => null,
];
}
$reflected = new ReflectionClass($m);
$reflectedMethod = $reflected->getMethod('handle');
return [
'class' => $m,
'uri' => $reflected->getFileName(),
'startLine' =>
$reflectedMethod->getFileName() === $reflected->getFileName()
? $reflectedMethod->getStartLine()
: null,
];
})->all();
return $result;
}
$reflected = new ReflectionClass($middleware);
$reflectedMethod = $reflected->getMethod('handle');
$result = array_merge($result, [
'class' => $middleware,
'uri' => $reflected->getFileName(),
'startLine' => $reflectedMethod->getStartLine(),
]);
$parameters = collect($reflectedMethod->getParameters())
->filter(function ($rc) {
return $rc->getName() !== 'request' && $rc->getName() !== 'next';
})
->map(function ($rc) {
return $rc->getName() . ($rc->isVariadic() ? '...' : '');
});
if ($parameters->isEmpty()) {
return $result;
}
return array_merge($result, [
'parameters' => $parameters->implode(','),
]);
});
================================================
FILE: php-templates/routes.php
================================================
<?php
function vsCodeGetRouterReflection(Illuminate\Routing\Route $route)
{
if ($route->getActionName() === 'Closure') {
return new ReflectionFunction($route->getAction()['uses']);
}
if (!str_contains($route->getActionName(), '@')) {
return new ReflectionClass($route->getActionName());
}
try {
return new ReflectionMethod($route->getControllerClass(), $route->getActionMethod());
} catch (Throwable $e) {
$namespace = app(Illuminate\Routing\UrlGenerator::class)->getRootControllerNamespace()
?? (app()->getNamespace() . 'Http\Controllers');
return new ReflectionMethod(
$namespace . '\\' . ltrim($route->getControllerClass(), '\\'),
$route->getActionMethod(),
);
}
}
return collect(app('router')->getRoutes()->getRoutes())
->map(function (Illuminate\Routing\Route $route) {
try {
$reflection = vsCodeGetRouterReflection($route);
} catch (Throwable $e) {
$reflection = null;
}
return [
'method' => collect($route->methods())->filter(function ($method) {
return $method !== 'HEAD';
})->implode('|'),
'uri' => $route->uri(),
'name' => $route->getName(),
'action' => $route->getActionName(),
'parameters' => $route->parameterNames(),
'filename' => $reflection ? $reflection->getFileName() : null,
'line' => $reflection ? $reflection->getStartLine() : null,
];
})
;
================================================
FILE: php-templates/translations.php
================================================
<?php
function vsCodeGetTranslationsFromFile(Symfony\Component\Finder\SplFileInfo $file, $path, $namespace)
{
if ($file->getExtension() !== 'php') {
return null;
}
$filePath = $file->getRealPath();
$relativePath = trim(str_replace($path, '', $file->getPath()), DIRECTORY_SEPARATOR);
$lang = explode(DIRECTORY_SEPARATOR, $relativePath)[0] ?? null;
if (!$lang) {
return null;
}
$keyPath = str_replace($path . DIRECTORY_SEPARATOR . $lang . DIRECTORY_SEPARATOR, '', $filePath);
$keyWithSlashes = str_replace('.php', '', $keyPath);
$baseKey = str_replace(DIRECTORY_SEPARATOR, '.', $keyWithSlashes);
if ($namespace) {
$baseKey = "{$namespace}::{$baseKey}";
}
try {
$translations = require $filePath;
} catch (Throwable $e) {
return null;
}
if (!is_array($translations)) {
return null;
}
$fileLines = Illuminate\Support\Facades\File::lines($filePath);
$lines = [];
$inComment = false;
foreach ($fileLines as $index => $line) {
$trimmed = trim($line);
if (str_starts_with($trimmed, '/*')) {
$inComment = true;
}
if ($inComment) {
if (str_ends_with($trimmed, '*/')) {
$inComment = false;
}
continue;
}
if (str_starts_with($trimmed, '//')) {
continue;
}
$lines[] = [$index + 1, $trimmed];
}
return [
'k' => $baseKey,
'la' => $lang,
'vs' => collect(Illuminate\Support\Arr::dot($translations))
->map(
fn ($value, $dotKey) => vsCodeTranslationValue(
$dotKey,
$value,
str_replace(base_path(DIRECTORY_SEPARATOR), '', $filePath),
$lines
)
)
->filter(),
];
}
function vsCodeTranslationValue($key, $value, $file, $lines): ?array
{
if (is_array($value)) {
return null;
}
$lineNumber = 1;
$keys = explode('.', $key);
$currentKey = array_shift($keys);
foreach ($lines as $line) {
if (
strpos($line[1], '"' . $currentKey . '"') !== false ||
strpos($line[1], "'" . $currentKey . "'") !== false
) {
$lineNumber = $line[0];
$currentKey = array_shift($keys);
}
if ($currentKey === null) {
break;
}
}
return [
'v' => $value,
'p' => $file,
'li' => $lineNumber,
'pa' => preg_match_all("/\:([A-Za-z0-9_]+)/", $value, $matches)
? $matches[1]
: [],
];
}
function vscodeCollectTranslations(string $path, ?string $namespace = null)
{
$realPath = realpath($path);
if (!is_dir($realPath)) {
return collect();
}
return collect(Illuminate\Support\Facades\File::allFiles($realPath))
->map(fn ($file) => vsCodeGetTranslationsFromFile($file, $path, $namespace))
->filter();
}
$loader = app('translator')->getLoader();
$namespaces = $loader->namespaces();
$reflection = new ReflectionClass($loader);
$property = $reflection->hasProperty('paths')
? $reflection->getProperty('paths')
: $reflection->getProperty('path');
$paths = Illuminate\Support\Arr::wrap($property->getValue($loader));
$default = collect($paths)->flatMap(
fn ($path) => vscodeCollectTranslations($path)
);
$namespaced = collect($namespaces)->flatMap(
fn ($path, $namespace) => vscodeCollectTranslations($path, $namespace)
);
$final = [];
foreach ($default->merge($namespaced) as $value) {
if (!isset($value['vs']) || !is_iterable($value['vs'])) {
continue;
}
foreach ($value['vs'] as $key => $v) {
$dotKey = "{$value['k']}.{$key}";
if (!isset($final[$dotKey])) {
$final[$dotKey] = [];
}
$final[$dotKey][$value['la']] = $v;
if ($value['la'] === Illuminate\Support\Facades\App::currentLocale()) {
$final[$dotKey]['default'] = $v;
}
}
}
return collect($final);
================================================
FILE: php-templates/views.php
================================================
<?php
function vsCodeFindBladeFiles($path)
{
$paths = [];
if (!is_dir($path)) {
return $paths;
}
foreach (
Symfony\Component\Finder\Finder::create()
->files()
->name('*.blade.php')
->in($path) as $file
) {
$paths[] = [
'path' => str_replace(base_path(DIRECTORY_SEPARATOR), '', $file->getRealPath()),
'isVendor' => str_contains($file->getRealPath(), base_path('vendor')),
'key' => Illuminate\Support\Str::of($file->getRealPath())
->replace(realpath($path), '')
->replace('.blade.php', '')
->ltrim(DIRECTORY_SEPARATOR)
->replace(DIRECTORY_SEPARATOR, '.'),
];
}
return $paths;
}
$paths = collect(
app('view')
->getFinder()
->getPaths()
)->flatMap(function ($path) {
return vsCodeFindBladeFiles($path);
});
$hints = collect(
app('view')
->getFinder()
->getHints()
)->flatMap(function ($paths, $key) {
return collect($paths)->flatMap(function ($path) use ($key) {
return collect(vsCodeFindBladeFiles($path))->map(function ($value) use (
$key
) {
return array_merge($value, ['key' => "{$key}::{$value['key']}"]);
});
});
});
[$local, $vendor] = $paths
->merge($hints)
->values()
->partition(function ($v) {
return !$v['isVendor'];
});
return $local
->sortBy('key', SORT_NATURAL)
->merge($vendor->sortBy('key', SORT_NATURAL));
================================================
FILE: phpstan-baseline.neon
================================================
parameters:
ignoreErrors:
-
message: '#^File ends with a trailing whitespace\. This may cause problems when running the code in the web browser\. Remove the closing \?\> mark or remove the whitespace\.$#'
identifier: whitespace.fileEnd
count: 1
path: resources/views/helper.php
-
message: '#^Call to an undefined method Illuminate\\Contracts\\Filesystem\\Filesystem\:\:requireOnce\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Console/MetaCommand.php
-
message: '#^Call to an undefined method Illuminate\\Contracts\\Foundation\\Application\:\:getBindings\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Console/MetaCommand.php
-
message: '#^Call to an undefined method Barryvdh\\Reflection\\DocBlock\\Tag\:\:getMethodName\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Console/ModelsCommand.php
-
message: '#^Call to an undefined method Barryvdh\\Reflection\\DocBlock\\Tag\:\:getType\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Console/ModelsCommand.php
-
message: '#^Call to an undefined method Barryvdh\\Reflection\\DocBlock\\Tag\:\:getVariableName\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Console/ModelsCommand.php
-
message: '#^Call to an undefined method Illuminate\\Support\\Optional\:\:getNumberOfParameters\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Console/ModelsCommand.php
-
message: '#^Call to an undefined method Illuminate\\Support\\Optional\:\:getParameters\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Console/ModelsCommand.php
-
message: '#^Call to an undefined method Illuminate\\Support\\Optional\:\:getReturnType\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Console/ModelsCommand.php
-
message: '#^Call to an undefined static method Illuminate\\Database\\Eloquent\\Model\:\:newFactory\(\)\.$#'
identifier: staticMethod.notFound
count: 2
path: src/Console/ModelsCommand.php
-
message: '#^Call to an undefined method ReflectionFunctionAbstract\:\:getDeclaringClass\(\)\.$#'
identifier: method.notFound
count: 1
path: src/Method.php
================================================
FILE: phpstan.neon
================================================
includes:
- phpstan-baseline.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
parameters:
level: 2
paths:
- src
- resources/views
excludePaths:
================================================
FILE: phpunit.xml.dist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
cacheDirectory=".phpunit.result.cache"
>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
================================================
FILE: resources/views/helper.php
================================================
<?= '<?php' ?>
<?php
/**
* @var Barryvdh\LaravelIdeHelper\Alias[][] $namespaces_by_alias_ns
* @var Barryvdh\LaravelIdeHelper\Alias[][] $namespaces_by_extends_ns
* @var string[] $real_time_facades
* @var bool $include_fluent
* @var string $helpers
*/
?>
/* @noinspection ALL */
// @formatter:off
// phpcs:ignoreFile
/**
* A helper file for Laravel, to provide autocomplete information to your IDE
* Generated for Laravel <?= app()->version() ?>.
*
* This file should not be included in your code, only analyzed by your IDE!
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
<?php
$s1 = ' ';
$s2 = $s1 . $s1;
$s3 = $s1 . $s2;
?>
<?php foreach ($namespaces_by_extends_ns as $namespace => $aliases) : ?>
namespace <?= $namespace === '__root' ? '' : trim($namespace, '\\') ?> {
<?php foreach ($aliases as $alias) : ?>
<?php echo trim($alias->getDocComment($s1)) . "\n{$s1}" . $alias->getClassType() ?> <?= $alias->getExtendsClass() ?><?php if ($alias->shouldExtendParentClass()): ?> extends <?= $alias->getParentClass() ?><?php endif; ?> {
<?php foreach ($alias->getMethods() as $method) : ?>
<?= trim($method->getDocComment($s2)) . "\n{$s2}" ?>public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
<?= "\n" . $s3?>//Method inherited from <?= $method->getDeclaringClass() ?>
<?php endif; ?>
<?php if ($method->isInstanceCall()) : ?>
<?= $s3 ?>/** @var <?=$method->getRoot()?> $instance */
<?php endif?>
<?= $s3 . ($method->shouldReturn() ? 'return ' : '') ?><?= $method->getRootMethodCall() ?>;
}
<?php endforeach; ?>
}
<?php endforeach; ?>
}
<?php endforeach; ?>
<?php foreach ($namespaces_by_alias_ns as $namespace => $aliases) : ?>
namespace <?= $namespace === '__root' ? '' : trim($namespace, '\\') ?> {
<?php foreach ($aliases as $alias) : ?>
<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
<?= "\n" . $alias->getPhpDocTemplates($s1) . "\n" ?>
<?php endif?>
<?= $s1 . $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
<?php foreach ($alias->getMethods() as $method) : ?>
<?= $s2 . trim($method->getDocComment($s2)) . "\n" ?>
<?= $s2 ?>public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
<?= $s2?>{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
<?= $s2 ?>//Method inherited from <?= $method->getDeclaringClass() ?>
<?php endif; ?>
<?php if ($method->isInstanceCall()) : ?>
<?= $s3 ?>/** @var <?=$method->getRoot()?> $instance */
<?php endif?>
<?= $s3 . ($method->shouldReturn() ? 'return ' : '') ?><?= $method->getRootMethodCall() ?>;
<?= $s2 ?>}
<?php endforeach; ?>
<?php endif; ?>}
<?php endforeach; ?>
}
<?php endforeach; ?>
<?php foreach ($real_time_facades as $name): ?>
<?php $nested = explode('\\', str_replace('\\' . class_basename($name), '', $name)); ?>
namespace <?php echo implode('\\', $nested); ?> {
/**
* @mixin <?= str_replace('Facades', '', $name) ?>
*/
class <?= class_basename($name) ?> extends <?= str_replace('Facades', '', $name) ?> {}
}
<?php endforeach; ?>
<?php if ($helpers) : ?>
namespace {
<?= $helpers ?>
}
<?php endif; ?>
<?php if ($include_fluent) : ?>
namespace Illuminate\Support {
/**
* Methods commonly used in migrations
*
* @method Fluent after(string $column) Add the after modifier
* @method Fluent charset(string $charset) Add the character set modifier
* @method Fluent collation(string $collation) Add the collation modifier
* @method Fluent comment(string $comment) Add comment
* @method Fluent default($value) Add the default modifier
* @method Fluent first() Select first row
* @method Fluent index(string $name = null) Add the in dex clause
* @method Fluent on(string $table) `on` of a foreign key
* @method Fluent onDelete(string $action) `on delete` of a foreign key
* @method Fluent onUpdate(string $action) `on update` of a foreign key
* @method Fluent primary() Add the primary key modifier
* @method Fluent references(string $column) `references` of a foreign key
* @method Fluent nullable(bool $value = true) Add the nullable modifier
* @method Fluent unique(string $name = null) Add unique index clause
* @method Fluent unsigned() Add the unsigned modifier
* @method Fluent useCurrent() Add the default timestamp value
* @method Fluent change() Add the change modifier
*/
class Fluent {}
}
<?php endif ?>
================================================
FILE: resources/views/meta.php
================================================
<?= '<?php' ?>
<?php
/**
* @var array $bindings
* @var string[] $methods
* @var string[] $configMethods
* @var Illuminate\Support\Collection $configValues
* @var array<string, array> $expectedArgumentSets
* @var array $expectedArguments
* @var string[] $userMethods
* @var string $userModel/
* */
?>
/* @noinspection ALL */
// @formatter:off
// phpcs:ignoreFile
namespace PHPSTORM_META {
/**
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
<?php foreach ($methods as $method) : ?>
override(<?= $method ?>, map([
'' => '@',
<?php foreach ($bindings as $abstract => $class) : ?>
'<?= $abstract ?>' => \<?= $class ?>::class,
<?php endforeach; ?>
]));
<?php endforeach; ?>
<?php foreach ($userMethods as $method) : ?>
override(<?= $method ?>, map([
'' => \<?= $userModel ?>::class,
]));
<?php endforeach; ?>
<?php foreach ($configMethods as $method) : ?>
override(<?= $method ?>, map([
<?php foreach ($configValues as $name => $value) : ?>
'<?= $name ?>' => '<?= $value ?>',
<?php endforeach; ?>
]));
<?php endforeach; ?>
override(\Illuminate\Foundation\Testing\Concerns\InteractsWithContainer::mock(0), map(["" => "@&\Mockery\MockInterface"]));
override(\Illuminate\Foundation\Testing\Concerns\InteractsWithContainer::partialMock(0), map(["" => "@&\Mockery\MockInterface"]));
override(\Illuminate\Foundation\Testing\Concerns\InteractsWithContainer::instance(0), type(1));
override(\Illuminate\Foundation\Testing\Concerns\InteractsWithContainer::spy(0), map(["" => "@&\Mockery\MockInterface"]));
override(\Illuminate\Support\Arr::add(0), type(0));
override(\Illuminate\Support\Arr::except(0), type(0));
override(\Illuminate\Support\Arr::first(0), elementType(0));
override(\Illuminate\Support\Arr::last(0), elementType(0));
override(\Illuminate\Support\Arr::get(0), elementType(0));
override(\Illuminate\Support\Arr::only(0), type(0));
override(\Illuminate\Support\Arr::prepend(0), type(0));
override(\Illuminate\Support\Arr::pull(0), elementType(0));
override(\Illuminate\Support\Arr::set(0), type(0));
override(\Illuminate\Support\Arr::shuffle(0), type(0));
override(\Illuminate\Support\Arr::sort(0), type(0));
override(\Illuminate\Support\Arr::sortRecursive(0), type(0));
override(\Illuminate\Support\Arr::where(0), type(0));
override(\array_add(0), type(0));
override(\array_except(0), type(0));
override(\array_first(0), elementType(0));
override(\array_last(0), elementType(0));
override(\array_get(0), elementType(0));
override(\array_only(0), type(0));
override(\array_prepend(0), type(0));
override(\array_pull(0), elementType(0));
override(\array_set(0), type(0));
override(\array_sort(0), type(0));
override(\array_sort_recursive(0), type(0));
override(\array_where(0), type(0));
override(\head(0), elementType(0));
override(\last(0), elementType(0));
override(\with(0), type(0));
override(\tap(0), type(0));
override(\optional(0), type(0));
<?php if ($expectedArgumentSets): ?>
<?php foreach ($expectedArgumentSets as $name => $argumentsList) : ?>
registerArgumentsSet('<?= $name ?>', <?php foreach ($argumentsList as $i => $arg) : ?><?php if ($i % 5 == 0) {
echo "\n";
} ?><?= var_export($arg, true); ?>,<?php endforeach; ?>);
<?php endforeach; ?>
<?php endif ?>
<?php if ($expectedArguments) : ?>
<?php foreach ($expectedArguments as $arguments) : ?>
<?php
$classes = isset($arguments['class']) ? (array) $arguments['class'] : [null];
$index = $arguments['index'] ?? 0;
$argumentSet = $arguments['argumentSet'];
$functions = [];
foreach ($classes as $class) {
foreach ((array) $arguments['method'] as $method) {
$functions[] = '\\' . ($class ? ltrim($class, '\\') . '::' : '') . $method . '()';
}
}
?>
<?php foreach ($functions as $function) : ?>
expectedArguments(<?= $function ?>, <?= $index ?>, argumentsSet('<?= $argumentSet ?>'));
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
}
================================================
FILE: src/Alias.php
================================================
<?php
/**
* Laravel IDE Helper Generator
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/barryvdh/laravel-ide-helper
*/
namespace Barryvdh\LaravelIdeHelper;
use Barryvdh\Reflection\DocBlock;
use Barryvdh\Reflection\DocBlock\Context;
use Barryvdh\Reflection\DocBlock\ContextFactory;
use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer;
use Barryvdh\Reflection\DocBlock\Tag\MethodTag;
use Barryvdh\Reflection\DocBlock\Tag\TemplateTag;
use Closure;
use Illuminate\Config\Repository as ConfigRepository;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\Traits\Macroable;
use ReflectionClass;
use Throwable;
class Alias
{
protected $alias;
/** @psalm-var class-string $facade */
protected $facade;
protected $extends = null;
protected $extendsClass = null;
protected $extendsNamespace = null;
protected $classType = 'class';
protected $short;
protected $namespace = '__root';
protected $parentClass;
protected $root = null;
protected $classes = [];
protected $methods = [];
protected $usedMethods = [];
protected $valid = false;
protected $magicMethods = [];
protected $interfaces = [];
protected $phpdoc = null;
protected $classAliases = [];
/** @var ConfigRepository */
protected $config;
/** @var string[] */
protected $templateNames;
/**
* @param ConfigRepository $config
* @param string $alias
* @psalm-param class-string $facade
* @param string $facade
* @param array $magicMethods
* @param array $interfaces
*/
public function __construct($config, $alias, $facade, $magicMethods = [], $interfaces = [])
{
$this->alias = $alias;
$this->magicMethods = $magicMethods;
$this->interfaces = $interfaces;
$this->config = $config;
// Make the class absolute
$facade = '\\' . ltrim($facade, '\\');
$this->facade = $facade;
$this->detectRoot();
if (!$this->root || $this->isTrait()) {
return;
}
$this->valid = true;
$this->addClass($this->root);
$this->detectFake();
$this->detectNamespace();
$this->detectClassType();
$this->detectExtendsNamespace();
$this->detectParentClass();
if (!empty($this->namespace)) {
try {
$this->classAliases = (new ContextFactory())->createFromReflector(new ReflectionClass($this->root))->getNamespaceAliases();
} catch (Throwable $e) {
$this->classAliases = [];
}
//Create a DocBlock and serializer instance
$this->phpdoc = new DocBlock(new ReflectionClass($alias), new Context($this->namespace, $this->classAliases));
}
if ($facade === '\Illuminate\Database\Eloquent\Model') {
$this->usedMethods = ['decrement' => true, 'increment' => true];
}
}
/**
* Add one or more classes to analyze
*
* @param array|string $classes
*/
public function addClass($classes)
{
$classes = (array)$classes;
foreach ($classes as $class) {
if (class_exists($class) || interface_exists($class)) {
$this->classes[] = $class;
} else {
echo "Class not exists: $class\r\n";
}
}
}
/**
* Check if this class is valid to process.
* @return bool
*/
public function isValid()
{
return $this->valid;
}
/**
* Get the classtype, 'interface' or 'class'
*
* @return string
*/
public function getClasstype()
{
return $this->classType;
}
/**
* Get the class which this alias extends
*
* @return null|string
*/
public function getExtends()
{
return $this->extends;
}
/**
* Get the class short name which this alias extends
*
* @return null|string
*/
public function getExtendsClass()
{
return $this->extendsClass;
}
/**
* Get the namespace of the class which this alias extends
*
* @return null|string
*/
public function getExtendsNamespace()
{
return $this->extendsNamespace;
}
/**
* Get the parent class of the class which this alias extends
*
* @return null|string
*/
public function getParentClass()
{
return $this->parentClass;
}
/**
* Check if this class should extend the parent class
*/
public function shouldExtendParentClass()
{
return $this->parentClass
&& !is_subclass_of($this->extends, Facade::class);
}
/**
* Get the Alias by which this class is called
*
* @return string
*/
public function getAlias()
{
return $this->alias;
}
/**
* Return the short name (without namespace)
*/
public function getShortName()
{
return $this->short;
}
/**
* Get the namespace from the alias
*
* @return string
*/
public function getNamespace()
{
return $this->namespace;
}
/**
* Get the methods found by this Alias
*
* @return array|Method[]
*/
public function getMethods()
{
if (count($this->methods) > 0) {
return $this->methods;
}
$this->addMagicMethods();
$this->detectMethods();
return $this->methods;
}
/**
* Detect class returned by ::fake()
*/
protected function detectFake()
{
$facade = $this->facade;
if (!is_subclass_of($facade, Facade::class)) {
return;
}
if (!method_exists($facade, 'fake')) {
return;
}
$reflection = new \ReflectionMethod($facade, 'fake');
if ($reflection->getNumberOfRequiredParameters() > 0) {
return;
}
$real = $facade::getFacadeRoot();
try {
$facade::fake();
$fake = $facade::getFacadeRoot();
if ($fake !== $real) {
$this->addClass(get_class($fake));
}
} finally {
$facade::swap($real);
}
}
/**
* Detect the namespace
*/
protected function detectNamespace()
{
if (strpos($this->alias, '\\')) {
$nsParts = explode('\\', $this->alias);
$this->short = array_pop($nsParts);
$this->namespace = implode('\\', $nsParts);
} else {
$this->short = $this->alias;
}
}
/**
* Detect the extends namespace
*/
protected function detectExtendsNamespace()
{
if (strpos($this->extends, '\\') !== false) {
$nsParts = explode('\\', $this->extends);
$this->extendsClass = array_pop($nsParts);
$this->extendsNamespace = implode('\\', $nsParts);
}
}
/**
* Detect the parent class
*/
protected function detectParentClass()
{
$reflection = new ReflectionClass($this->root);
$parentClass = $reflection->getParentClass();
$this->parentClass = $parentClass ? '\\' . $parentClass->getName() : null;
}
/**
* Detect the class type
*/
protected function detectClassType()
{
//Some classes extend the facade
if (interface_exists($this->facade)) {
$this->classType = 'interface';
$this->extends = $this->facade;
} else {
$this->classType = 'class';
if (class_exists($this->facade)) {
$this->extends = $this->facade;
}
}
}
/**
* Get the real root of a facade
*
*/
protected function detectRoot(): void
{
$facade = $this->facade;
try {
//If possible, get the facade root
if (method_exists($facade, 'getFacadeRoot')) {
$root = get_class($facade::getFacadeRoot());
} else {
$root = $facade;
}
//If it doesn't exist, skip it
if (!class_exists($root) && !interface_exists($root)) {
return;
}
$this->root = $root;
//When the database connection is not set, some classes will be skipped
} catch (\PDOException $e) {
$this->error(
'PDOException: ' . $e->getMessage() .
"\nPlease configure your database connection correctly, or use the sqlite memory driver (-M)." .
" Skipping $facade."
);
} catch (Throwable $e) {
$this->error('Exception: ' . $e->getMessage() . "\nSkipping $facade.");
}
}
/**
* Detect if this class is a trait or not.
*
* @return bool
*/
protected function isTrait()
{
// Check if the facade is not a Trait
return trait_exists($this->facade);
}
/**
* Add magic methods, as defined in the configuration files
*/
protected function addMagicMethods()
{
foreach ($this->magicMethods as $magic => $real) {
[$className, $name] = explode('::', $real);
if ((!class_exists($className) && !interface_exists($className)) || !method_exists($className, $name)) {
continue;
}
$method = new \ReflectionMethod($className, $name);
$class = new ReflectionClass($className);
if (!isset($this->usedMethods[$magic])) {
if ($class !== $this->root) {
$this->methods[] = new Method(
$method,
$class,
$magic,
$this->interfaces,
$this->classAliases,
$this->getReturnTypeNormalizers($class),
$this->getTemplateNames()
);
}
$this->usedMethods[$magic] = true;
}
}
}
/**
* Get the methods for one or multiple classes.
*
*/
protected function detectMethods()
{
foreach ($this->classes as $class) {
$reflection = new ReflectionClass($class);
$methods = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC);
if ($methods) {
foreach ($methods as $method) {
if (!isset($this->usedMethods[$method->name])) {
// Only add the methods to the output when the root is not the same as the class.
// And don't add the __*() methods
if ($this->extends !== $class && substr($method->name, 0, 2) !== '__') {
$this->methods[] = new Method(
$method,
$reflection,
$method->name,
$this->interfaces,
$this->classAliases,
$this->getReturnTypeNormalizers($reflection),
$this->getTemplateNames(),
);
}
$this->usedMethods[$method->name] = true;
}
}
}
// Check if the class is macroable
// (Eloquent\Builder is also macroable but doesn't use Macroable trait)
if ($class === EloquentBuilder::class || in_array(Macroable::class, $reflection->getTraitNames())) {
$properties = $reflection->getStaticProperties();
$macros = isset($properties['macros']) ? $properties['macros'] : [];
foreach ($macros as $macro_name => $macro_func) {
if (!isset($this->usedMethods[$macro_name])) {
try {
$method = $this->getMacroFunction($macro_func);
} catch (Throwable $e) {
// Invalid method, skip
continue;
}
// Add macros
$this->methods[] = new Macro(
$method,
$reflection,
$macro_name,
$this->interfaces,
$this->classAliases,
$this->getReturnTypeNormalizers($reflection)
);
$this->usedMethods[$macro_name] = true;
}
}
}
}
}
/**
* @param ReflectionClass $class
* @return array<string, string>
*/
protected function getReturnTypeNormalizers($class)
{
if ($this->alias === 'Eloquent' && in_array($class->getName(), [EloquentBuilder::class, QueryBuilder::class])) {
return [
'$this' => '\\' . EloquentBuilder::class . ($this->config->get('ide-helper.use_generics_annotations') ? '<static>' : '|static'),
];
}
return [];
}
/**
* @param $macro_func
*
* @return \ReflectionFunctionAbstract
* @throws \ReflectionException
*/
protected function getMacroFunction($macro_func)
{
if (is_array($macro_func) && is_callable($macro_func)) {
return new \ReflectionMethod($macro_func[0], $macro_func[1]);
}
if (is_object($macro_func) && is_callable($macro_func) && !$macro_func instanceof Closure) {
return new \ReflectionMethod($macro_func, '__invoke');
}
return new \ReflectionFunction($macro_func);
}
/*
* Get the docblock for this alias
*
* @param string $prefix
* @return mixed
*/
public function getDocComment($prefix = "\t\t")
{
$serializer = new DocBlockSerializer(1, $prefix);
if (!$this->phpdoc) {
return '';
}
if ($this->config->get('ide-helper.include_class_docblocks')) {
// if a class doesn't expose any DocBlock tags
// we can perform reflection on the class and
// add in the original class DocBlock
if (count($this->phpdoc->getTags()) === 0) {
$class = new ReflectionClass($this->root);
$this->phpdoc = new DocBlock($class->getDocComment());
}
}
$this->removeDuplicateMethodsFromPhpDoc();
return $serializer->getDocComment($this->phpdoc);
}
/**
* @param $prefix
* @return string
*/
public function getPhpDocTemplates($prefix = "\t\t")
{
$templateDoc = new DocBlock('');
$serializer = new DocBlockSerializer(1, $prefix);
foreach ($this->getTemplateNames() as $templateName) {
$template = new TemplateTag('template', $templateName);
$template->setBound('static');
$template->setDocBlock($templateDoc);
$templateDoc->appendTag($template);
}
return $serializer->getDocComment($templateDoc);
}
/**
* @return string[]
*/
public function getTemplateNames()
{
if (!isset($this->templateNames)) {
$this->detectTemplateNames();
}
return $this->templateNames;
}
/**
* @return void
* @throws \ReflectionException
*/
protected function detectTemplateNames()
{
$templateNames = [];
foreach ($this->classes as $class) {
$reflection = new ReflectionClass($class);
$traits = collect($reflection->getTraitNames());
$phpdoc = new DocBlock($reflection);
$templates = $phpdoc->getTagsByName('template');
/** @var TemplateTag $template */
foreach ($templates as $template) {
$templateNames[] = $template->getTemplateName();
}
foreach ($traits as $trait) {
$phpdoc = new DocBlock(new ReflectionClass($trait));
$templates = $phpdoc->getTagsByName('template');
/** @var TemplateTag $template */
foreach ($templates as $template) {
$templateNames[] = $template->getTemplateName();
}
}
}
$this->templateNames = $templateNames;
}
/**
* Removes method tags from the doc comment that already appear as functions inside the class.
* This prevents duplicate function errors in the IDE.
*
* @return void
*/
protected function removeDuplicateMethodsFromPhpDoc()
{
$methodNames = [];
foreach ($this->getMethods() as $method) {
$methodNames[$method->getName()] = true;
}
foreach ($this->phpdoc->getTags() as $tag) {
if ($tag instanceof MethodTag && isset($methodNames[$tag->getMethodName()])) {
$this->phpdoc->deleteTag($tag);
}
}
}
/**
* Output an error.
*
* @param string $string
* @return void
*/
protected function error($string)
{
echo $string . "\r\n";
}
}
================================================
FILE: src/Console/EloquentCommand.php
================================================
<?php
/**
* Laravel IDE Helper Generator - Eloquent Model Mixin
*
* @author Charles A. Peterson <artistan@gmail.com>
* @copyright 2017 Charles A. Peterson / Fruitcake Studio (http://www.fruitcakestudio.nl)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/barryvdh/laravel-ide-helper
*/
namespace Barryvdh\LaravelIdeHelper\Console;
use Barryvdh\LaravelIdeHelper\Eloquent;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
/**
* A command to add \Eloquent mixin to Eloquent\Model
*
* @author Charles A. Peterson <artistan@gmail.com>
*/
class EloquentCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'ide-helper:eloquent';
/**
* @var Filesystem $files
*/
protected $files;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Add \Eloquent helper to \Eloquent\Model';
/**
* @param Filesystem $files
*/
public function __construct(Filesystem $files)
{
parent::__construct();
$this->files = $files;
}
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
Eloquent::writeEloquentModelHelper($this, $this->files);
}
}
================================================
FILE: src/Console/GeneratorCommand.php
================================================
<?php
/**
* Laravel IDE Helper Generator
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/barryvdh/laravel-ide-helper
*/
namespace Barryvdh\LaravelIdeHelper\Console;
use Barryvdh\LaravelIdeHelper\Eloquent;
use Barryvdh\LaravelIdeHelper\Generator;
use Illuminate\Console\Command;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Filesystem\Filesystem;
use Illuminate\View\Factory;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
/**
* A command to generate autocomplete information for your IDE
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
class GeneratorCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'ide-helper:generate';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Generate a new IDE Helper file.';
/** @var \Illuminate\Config\Repository */
protected $config;
/** @var Filesystem */
protected $files;
/** @var Factory */
protected $view;
protected $onlyExtend;
/**
*
* @param \Illuminate\Config\Repository $config
* @param Filesystem $files
* @param Factory $view
*/
public function __construct(
Repository $config,
Filesystem $files,
Factory $view
) {
$this->config = $config;
$this->files = $files;
$this->view = $view;
parent::__construct();
}
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
if (
file_exists(base_path() . '/vendor/compiled.php') ||
file_exists(base_path() . '/bootstrap/cache/compiled.php') ||
file_exists(base_path() . '/storage/framework/compiled.php')
) {
$this->error(
'Error generating IDE Helper: first delete your compiled file (php artisan clear-compiled)'
);
return;
}
$filename = $this->argument('filename');
// Add the php extension if missing
// This is a backwards-compatible shim and can be removed in the future
if (substr($filename, -4, 4) !== '.php') {
$filename .= '.php';
}
if ($this->option('memory')) {
$this->useMemoryDriver();
}
$helpers = '';
if ($this->option('helpers') || ($this->config->get('ide-helper.include_helpers'))) {
foreach ($this->config->get('ide-helper.helper_files', []) as $helper) {
if (file_exists($helper)) {
$helpers .= str_replace(['<?php', '?>'], '', $this->files->get($helper));
}
}
} else {
$helpers = '';
}
$generator = new Generator($this->config, $this->view, $this->getOutput(), $helpers);
if ($this->option('eloquent')) {
$content = $generator->generateEloquent();
} else {
$content = $generator->generate();
}
$written = $this->files->put($filename, $content);
if ($written !== false) {
$this->info("A new helper file was written to $filename");
if ($this->option('write_mixins')) {
Eloquent::writeEloquentModelHelper($this, $this->files);
}
} else {
$this->error("The helper file could not be created at $filename");
}
}
protected function useMemoryDriver()
{
//Use a sqlite database in memory, to avoid connection errors on Database facades
$this->config->set(
'database.connections.sqlite',
[
'driver' => 'sqlite',
'database' => ':memory:',
]
);
$this->config->set('database.default', 'sqlite');
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
$filename = $this->config->get('ide-helper.filename');
return [
[
'filename', InputArgument::OPTIONAL, 'The path to the helper file', $filename,
],
];
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
$writeMixins = $this->config->get('ide-helper.write_eloquent_model_mixins');
return [
['write_mixins', 'W', InputOption::VALUE_OPTIONAL, 'Write mixins to Laravel Model?', $writeMixins],
['helpers', 'H', InputOption::VALUE_NONE, 'Include the helper files'],
['memory', 'M', InputOption::VALUE_NONE, 'Use sqlite memory driver'],
['eloquent', 'E', InputOption::VALUE_NONE, 'Only write Eloquent methods'],
];
}
}
================================================
FILE: src/Console/MetaCommand.php
================================================
<?php
/**
* Laravel IDE Helper Generator
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @copyright 2015 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/barryvdh/laravel-ide-helper
*/
namespace Barryvdh\LaravelIdeHelper\Console;
use Dotenv\Parser\Entry;
use Dotenv\Parser\Parser;
use Illuminate\Console\Command;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Contracts\View\Factory;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Collection;
use RuntimeException;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
* A command to generate phpstorm meta data
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
class MetaCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'ide-helper:meta';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Generate metadata for PhpStorm';
/** @var \Illuminate\Contracts\Filesystem\Filesystem */
protected $files;
/** @var Factory */
protected $view;
/** @var Repository */
protected $config;
protected $methods = [
'new \Illuminate\Contracts\Container\Container',
'\Illuminate\Container\Container::makeWith(0)',
'\Illuminate\Contracts\Container\Container::get(0)',
'\Illuminate\Contracts\Container\Container::make(0)',
'\Illuminate\Contracts\Container\Container::makeWith(0)',
'\App::get(0)',
'\App::make(0)',
'\App::makeWith(0)',
'\app(0)',
'\resolve(0)',
'\Psr\Container\ContainerInterface::get(0)',
];
protected $configMethods = [
'\config()',
'\Illuminate\Config\Repository::get()',
'\Illuminate\Support\Facades\Config::get()',
];
protected $userMethods = [
'\auth()->user()',
'\Illuminate\Contracts\Auth\Guard::user()',
'\Illuminate\Support\Facades\Auth::user()',
'\request()->user()',
'\Illuminate\Http\Request::user()',
'\Illuminate\Support\Facades\Request::user()',
];
protected $templateCache = [];
/**
*
* @param Filesystem $files
* @param Factory $view
* @param Repository $config
*/
public function __construct(
Filesystem $files,
Factory $view,
Repository $config
) {
$this->files = $files;
$this->view = $view;
$this->config = $config;
parent::__construct();
}
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$ourAutoloader = $this->registerClassAutoloadExceptions();
$bindings = [];
foreach ($this->getAbstracts() as $abstract) {
// Validator and seeder cause problems
if (in_array($abstract, ['validator', 'seeder'])) {
continue;
}
try {
$concrete = $this->laravel->make($abstract);
if ($concrete === null) {
throw new RuntimeException("Cannot create instance for '$abstract', received 'null'");
}
$reflectionClass = new \ReflectionClass($concrete);
if (is_object($concrete) && !$reflectionClass->isAnonymous() && $abstract !== get_class($concrete)) {
$bindings[$abstract] = get_class($concrete);
}
} catch (\Throwable $e) {
if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
$this->comment("Cannot make '$abstract': " . $e->getMessage());
}
}
}
$this->unregisterClassAutoloadExceptions($ourAutoloader);
$configValues = $this->loadTemplate('configs')->pluck('value', 'name')->map(function ($value, $key) {
return gettype($value);
});
$defaultUserModel = $this->config->get('auth.providers.users.model', $this->config->get('auth.model', 'App\User'));
$content = $this->view->make('ide-helper::meta', [
'bindings' => $bindings,
'methods' => $this->methods,
'configMethods' => $this->configMethods,
'configValues' => $configValues,
'expectedArgumentSets' => $this->getExpectedArgumentSets(),
'expectedArguments' => $this->getExpectedArguments(),
'userModel' => $defaultUserModel,
'userMethods' => $this->userMethods,
])->render();
$filename = $this->option('filename');
$written = $this->files->put($filename, $content);
if ($written !== false) {
$this->info("A new meta file was written to $filename");
} else {
$this->error("The meta file could not be created at $filename");
}
}
/**
* Get a list of abstracts from the Laravel Application.
*
* @return array
*/
protected function getAbstracts()
{
$abstracts = $this->laravel->getBindings();
// Return the abstract names only
$keys = array_keys($abstracts);
sort($keys);
return $keys;
}
/**
* Register an autoloader the throws exceptions when a class is not found.
*
* @return callable
*/
protected function registerClassAutoloadExceptions(): callable
{
$aliases = array_filter([...$this->getAbstracts(), 'config'], fn ($abstract) => !str_contains($abstract, '\\'));
$autoloader = function ($class) use ($aliases) {
// ignore aliases as they're meant to be resolved elsewhere
if (in_array($class, $aliases, true)) {
return;
}
// Don't throw when class existence is being checked via class_exists(),
// interface_exists(), trait_exists(), or enum_exists(). These functions
// expect the autoloader to return gracefully when the class doesn't exist.
// Throwing here would break libraries that use class_exists() to check for
// optional dependencies (e.g. Doctrine ORM checking for removed classes).
$existsFunctions = ['class_exists', 'interface_exists', 'trait_exists', 'enum_exists'];
foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3) as $frame) {
if (isset($frame['function']) && in_array($frame['function'], $existsFunctions, true)) {
return;
}
}
throw new \ReflectionException("Class '$class' not found.");
};
spl_autoload_register($autoloader);
return $autoloader;
}
protected function getExpectedArgumentSets()
{
return [
'auth' => $this->loadTemplate('auth')->keys()->filter()->toArray(),
'configs' => $this->loadTemplate('configs')->pluck('name')->filter()->toArray(),
'middleware' => $this->loadTemplate('middleware')->keys()->filter()->toArray(),
'routes' => $this->loadTemplate('routes')->pluck('name')->filter()->toArray(),
'views' => $this->loadTemplate('views')->pluck('key')->filter()->map(function ($value) {
return (string) $value;
})->toArray(),
'translations' => $this->loadTemplate('translations')->filter()->keys()->toArray(),
'env' => $this->getEnv(),
];
}
protected function getExpectedArguments()
{
return [
[
'class' => '\Illuminate\Support\Facades\Gate',
'method' => [
'has',
'allows',
'denies',
'check',
'any',
'none',
'authorize',
'inspect',
],
'argumentSet' => 'auth',
],
[
'class' => ['\Illuminate\Support\Facades\Route', '\Illuminate\Support\Facades\Auth', 'Illuminate\Foundation\Auth\Access\Authorizable'],
'method' => ['can', 'cannot', 'cant'],
'argumentSet' => 'auth',
],
[
'class' => ['Illuminate\Contracts\Auth\Access\Authorizable'],
'method' => ['can'],
'argumentSet' => 'auth',
],
[
'class' => ['\Illuminate\Config\Repository', '\Illuminate\Support\Facades\Config'],
'method' => [
// 'get', // config() and Config::Get() are added with return type hints already
'getMany',
'set',
'string',
'integer',
'boolean',
'float',
'array',
'prepend',
'push',
],
'argumentSet' => 'configs',
],
[
'class' => ['\Illuminate\Support\Facades\Route', '\Illuminate\Routing\Router'],
'method' => ['middleware', 'withoutMiddleware'],
'argumentSet' => 'middleware',
],
[
'method' => ['route', 'to_route', 'signedRoute'],
'argumentSet' => 'routes',
],
[
'class' => [
'\Illuminate\Support\Facades\Redirect',
'\Illuminate\Support\Facades\URL',
'\Illuminate\Routing\Redirector',
'\Illuminate\Routing\UrlGenerator',
],
'method' => ['route', 'signedRoute', 'temporarySignedRoute'],
'argumentSet' => 'routes',
],
[
'method' => 'view',
'argumentSet' => 'views',
],
[
'class' => ['\Illuminate\Support\Facades\View', '\Illuminate\View\Factory'],
'method' => 'make',
'argumentSet' => 'views',
],
[
'method' => ['__', 'trans'],
'argumentSet' => 'translations',
],
[
'class' => ['\Illuminate\Contracts\Translation\Translator'],
'method' => ['get'],
'argumentSet' => 'translations',
],
[
'method' => 'env',
'argumentSet' => 'env',
],
[
'class' => '\Illuminate\Support\Env',
'method' => 'get',
'argumentSet' => 'env',
],
];
}
/**
* @return Collection
*/
protected function loadTemplate($name)
{
if (!isset($this->templateCache[$name])) {
$file = __DIR__ . '/../../php-templates/' . basename($name) . '.php';
try {
$value = $this->files->requireOnce($file) ?: [];
} catch (\Throwable $e) {
$value = [];
$this->warn('Cannot load template for ' . $name . ': ' . $e->getMessage());
}
if (!$value instanceof Collection) {
$value = collect($value);
}
$this->templateCache[$name] = $value;
}
return $this->templateCache[$name];
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
$filename = $this->config->get('ide-helper.meta_filename');
return [
['filename', 'F', InputOption::VALUE_OPTIONAL, 'The path to the meta file', $filename],
];
}
protected function getEnv()
{
$envPath = base_path('.env');
if (!file_exists($envPath)) {
return [];
}
$parser = new Parser();
$entries = $parser->parse(file_get_contents($envPath));
return collect($entries)->map(function (Entry $entry) {
return $entry->getName();
});
}
/**
* Remove our custom autoloader that we pushed onto the autoload stack
*
* @param callable $ourAutoloader
*/
private function unregisterClassAutoloadExceptions(callable $ourAutoloader): void
{
spl_autoload_unregister($ourAutoloader);
}
}
================================================
FILE: src/Console/ModelsCommand.php
================================================
<?php
/**
* Laravel IDE Helper Generator
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @copyright 2014 Barry vd. Heuvel / Fruitcake Studio (http://www.fruitcakestudio.nl)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://github.com/barryvdh/laravel-ide-helper
*/
namespace Barryvdh\LaravelIdeHelper\Console;
use Barryvdh\LaravelIdeHelper\Contracts\ModelHookInterface;
use Barryvdh\LaravelIdeHelper\Generator;
use Barryvdh\LaravelIdeHelper\Parsers\PhpDocReturnTypeParser;
use Barryvdh\Reflection\DocBlock;
use Barryvdh\Reflection\DocBlock\Context;
use Barryvdh\Reflection\DocBlock\ContextFactory;
use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer;
use Barryvdh\Reflection\DocBlock\Tag;
use Composer\ClassMapGenerator\ClassMapGenerator;
use Illuminate\Console\Command;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Contracts\Database\Eloquent\Castable;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes;
use Illuminate\Database\Eloquent\Casts\AsArrayObject;
use Illuminate\Database\Eloquent\Casts\AsCollection;
use Illuminate\Database\Eloquent\Casts\AsEnumCollection;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\Relations\MorphOne;
use Illuminate\Database\Eloquent\Relations\MorphPivot;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Illuminate\Database\Eloquent\Relations\Pivot;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Schema\Builder;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Illuminate\View\Factory as ViewFactory;
use ReflectionClass;
use ReflectionNamedType;
use ReflectionObject;
use ReflectionType;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Throwable;
/**
* A command to generate autocomplete information for your IDE
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
class ModelsCommand extends Command
{
protected const RELATION_TYPES = [
'hasMany' => HasMany::class,
'hasManyThrough' => HasManyThrough::class,
'hasOneThrough' => HasOneThrough::class,
'belongsToMany' => BelongsToMany::class,
'hasOne' => HasOne::class,
'belongsTo' => BelongsTo::class,
'morphOne' => MorphOne::class,
'morphTo' => MorphTo::class,
'morphMany' => MorphMany::class,
'morphToMany' => MorphToMany::class,
'morphedByMany' => MorphToMany::class,
];
/**
* @var Filesystem $files
*/
protected $files;
/**
* @var Repository
*/
protected $config;
/** @var ViewFactory */
protected $view;
/**
* The console command name.
*
* @var string
*/
protected $name = 'ide-helper:models';
/**
* @var string
*/
protected $filename;
/**
* The console command description.
*
* @var string
*/
protected $description = 'Generate autocompletion for models';
protected $write_model_magic_where;
protected $write_model_relation_count_properties;
protected $write_model_relation_exists_properties;
protected $properties = [];
protected $methods = [];
protected $write = false;
protected $write_mixin = false;
protected $dirs = [];
protected $reset;
protected $phpstorm_noinspections;
protected $write_model_external_builder_methods;
/**
* @var array<string, \SplFileObject>
*/
protected $fileCache = [];
/**
* @var array<string, Context>
*/
protected $contextCache = [];
/**
* @var array<string, true>
*/
protected $nullableColumns = [];
/**
* @var string[]
*/
protected $foreignKeyConstraintsColumns = [];
/**
* During initialization we use Laravels Date Facade to
* determine the actual date class and store it here.
*
* @var string
*/
protected $dateClass;
/**
* @param Filesystem $files
*/
public function __construct(Filesystem $files, Repository $config, ViewFactory $view)
{
$this->config = $config;
$this->files = $files;
$this->view = $view;
parent::__construct();
}
/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$this->filename = $this->laravel['config']->get('ide-helper.models_filename', '_ide_helper_models.php');
$filename = $this->option('filename') ?? $this->filename;
$this->write = $this->option('write');
$this->write_mixin = $this->option('write-mixin');
$this->dirs = array_merge(
$this->laravel['config']->get('ide-helper.model_locations', []),
$this->option('dir')
);
$model = $this->argument('model');
$ignore = $this->option('ignore');
$this->reset = $this->option('reset');
$this->phpstorm_noinspections = $this->option('phpstorm-noinspections');
$this->write_model_magic_where = $this->laravel['config']->get('ide-helper.write_model_magic_where', true);
$this->write_model_external_builder_methods = $this->laravel['config']->get('ide-helper.write_model_external_builder_methods', true);
$this->write_model_relation_count_properties =
$this->laravel['config']->get('ide-helper.write_model_relation_count_properties', true);
$this->write_model_relation_exists_properties =
$this->laravel['config']->get('ide-helper.write_model_relation_exists_properties', false);
$this->write = $this->write_mixin ? true : $this->write;
//If filename is default and Write is not specified, ask what to do
if (!$this->write && $filename === $this->filename && !$this->option('nowrite')) {
if (
$this->confirm(
"Do you want to overwrite the existing model files? Choose no to write to $filename instead"
)
) {
$this->write = true;
}
}
$this->dateClass = class_exists(\Illuminate\Support\Facades\Date::class)
? '\\' . get_class(\Illuminate\Support\Facades\Date::now())
: '\Illuminate\Support\Carbon';
$content = $this->generateDocs($model, $ignore);
if (!$this->write || $this->write_mixin) {
$written = $this->files->put($filename, $content);
if ($written !== false) {
$this->info("Model information was written to $filename");
} else {
$this->error("Failed to write model information to $filename");
}
}
$helperFilename = $this->config->get('ide-helper.filename');
$writeHelper = $this->option('write-eloquent-helper');
if (!$writeHelper && !$this->files->exists($helperFilename) && ($this->write || $this->write_mixin)) {
if ($this->confirm("{$helperFilename} does not exist.
Do you want to generate a minimal helper to generate the Eloquent methods?")) {
$writeHelper = true;
}
}
if ($writeHelper) {
$generator = new Generator($this->config, $this->view, $this->getOutput());
$content = $generator->generateEloquent();
$written = $this->files->put($helperFilename, $content);
if ($written !== false) {
$this->info("Eloquent helper was written to $helperFilename");
} else {
$this->error("Failed to write eloquent helper to $helperFilename");
}
}
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['model', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Which models to include', []],
];
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['filename', 'F', InputOption::VALUE_OPTIONAL, 'The path to the helper file'],
['dir', 'D', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
'The model dir, supports glob patterns', [], ],
['write', 'W', InputOption::VALUE_NONE, 'Write to Model file'],
['write-mixin', 'M', InputOption::VALUE_NONE,
"Write models to {$this->filename} and adds @mixin to each model, avoiding IDE duplicate declaration warnings",
],
['write-eloquent-helper', 'E', InputOption::VALUE_NONE,
'Write Eloquent helper file to _ide_helper.php',
],
['nowrite', 'N', InputOption::VALUE_NONE, 'Don\'t write to Model file'],
['reset', 'R', InputOption::VALUE_NONE, 'Remove the original phpdocs instead of appending'],
['smart-reset', 'r', InputOption::VALUE_NONE, 'Retained for compatibility, while it no longer has any effect'],
['phpstorm-noinspections', 'p', InputOption::VALUE_NONE,
'Add PhpFullyQualifiedNameUsageInspection and PhpUnnecessaryFullyQualifiedNameInspection PHPStorm ' .
'noinspection tags',
],
['ignore', 'I', InputOption::VALUE_OPTIONAL, 'Which models to ignore', ''],
];
}
protected function generateDocs($loadModels, $ignore = '')
{
$output = "<?php
// @formatter:off
// phpcs:ignoreFile
/**
* A helper file for your Eloquent Models
* Copy the phpDocs from this file to the correct Model,
* And remove them from this file, to prevent double declarations.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
\n\n";
if (empty($loadModels)) {
$models = $this->loadModels();
} else {
$models = [];
foreach ($loadModels as $model) {
$models = array_merge($models, explode(',', $model));
}
}
$ignore = array_merge(
explode(',', $ignore),
$this->laravel['config']->get('ide-helper.ignored_models', [])
);
foreach ($models as $name) {
if (in_array($name, $ignore)) {
if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
$this->comment("Ignoring model '$name'");
}
continue;
}
$this->properties = [];
$this->methods = [];
$this->foreignKeyConstraintsColumns = [];
if (class_exists($name)) {
try {
// handle abstract classes, interfaces, ...
$reflectionClass = new ReflectionClass($name);
if (!$reflectionClass->isSubclassOf('Illuminate\Database\Eloquent\Model')) {
continue;
}
$this->comment("Loading model '$name'", OutputInterface::VERBOSITY_VERBOSE);
if (!$reflectionClass->IsInstantiable()) {
// ignore abstract class or interface
continue;
}
$model = $this->laravel->make($name);
$this->getPropertiesFromTable($model);
if (method_exists($model, 'getCasts')) {
$this->castPropertiesType($model);
}
$this->getPropertiesFromMethods($model);
$this->getSoftDeleteMethods($model);
$this->getCollectionMethods($model);
$this->getFactoryMethods($model);
$this->runModelHooks($model);
$output .= $this->createPhpDocs($name);
$ignore[] = $name;
$this->nullableColumns = [];
} catch (Throwable $e) {
$this->error('Exception: ' . $e->getMessage() .
"\nCould not analyze class $name.\n\nTrace:\n" .
$e->getTraceAsString());
}
}
}
return $output;
}
protected function loadModels()
{
$models = [];
foreach ($this->dirs as $dir) {
if (is_dir(base_path($dir))) {
$dir = base_path($dir);
}
$dirs = glob($dir, GLOB_ONLYDIR);
foreach ($dirs as $dir) {
if (!is_dir($dir)) {
$this->error("Cannot locate directory '{$dir}'");
continue;
}
if (file_exists($dir)) {
$classMap = ClassMapGenerator::createMap($dir);
// Sort list so it's stable across different environments
ksort($classMap);
foreach ($classMap as $model => $path) {
$models[] = $model;
}
}
}
}
return $models;
}
/**
* cast the properties's type from $casts.
*
* @param Model $model
*/
public function castPropertiesType($model)
{
$casts = $model->getCasts();
foreach ($casts as $name => $type) {
if (Str::startsWith($type, 'decimal:')) {
$type = 'decimal';
} elseif (Str::startsWith($type, 'custom_datetime:')) {
$type = 'date';
} elseif (Str::startsWith($type, 'date:')) {
$type = 'date';
} elseif (Str::startsWith($type, 'datetime:')) {
$type = 'date';
} elseif (Str::startsWith($type, 'immutable_custom_datetime:')) {
$type = 'immutable_date';
} elseif (Str::startsWith($type, 'immutable_date:')) {
$type = 'immutable_date';
} elseif (Str::startsWith($type, 'immutable_datetime:')) {
$type = 'immutable_datetime';
} elseif (Str::startsWith($type, 'encrypted:')) {
$type = Str::after($type, ':');
}
$params = [];
switch ($type) {
case 'boolean':
case 'bool':
$realType = 'bool';
break;
case 'decimal':
$realType = 'numeric';
break;
case 'encrypted':
case 'string':
case 'hashed':
$realType = 'string';
break;
case 'array':
case 'json':
$realType = 'array<array-key, mixed>';
break;
case 'object':
$realType = 'object';
break;
case 'int':
case 'integer':
case 'timestamp':
$realType = 'int';
break;
case 'real':
case 'double':
case 'float':
$realType = 'float';
break;
case 'date':
case 'datetime':
$realType = $this->dateClass;
break;
case 'immutable_date':
case 'immutable_datetime':
$realType = '\Carbon\CarbonImmutable';
break;
case 'collection':
$realType = '\Illuminate\Support\Collection<array-key, mixed>';
break;
case AsArrayObject::class:
$realType = '\Illuminate\Database\Eloquent\Casts\ArrayObject<array-key, mixed>';
break;
default:
// In case of an optional custom cast parameter , only evaluate
// the `$type` until the `:`
$type = strtok($type, ':');
$realType = class_exists($type) ? ('\\' . $type) : 'mixed';
$this->setProperty($name, null, true, true);
$params = strtok(':');
$params = $params ? explode(',', $params) : [];
break;
}
if (!isset($this->properties[$name])) {
continue;
}
if ($this->isInboundCast($realType)) {
continue;
}
if (Str::startsWith($type, AsCollection::class)) {
$realType = $this->getTypeInModel($model, $params[0] ?? null) ?: '\Illuminate\Support\Collection';
$relatedModel = $this->getTypeInModel($model, $params[1] ?? null);
if ($relatedModel) {
$realType = $this->getCollectionTypeHint($realType, $relatedModel);
}
}
if (Str::startsWith($type, AsEnumCollection::class)) {
$realType = '\Illuminate\Support\Collection';
$relatedModel = $this->getTypeInModel($model, $params[0] ?? null);
if ($relatedModel) {
$realType = $this->getCollectionTypeHint($realType, $relatedModel);
}
}
$realType = $this->checkForCastableCasts($realType, $params);
$realType = $this->checkForCustomLaravelCasts($realType);
$realType = $this->getTypeOverride($realType);
$realType = $this->getTypeInModel($model, $realType);
$realType = $this->applyNullability($realType, isset($this->nullableColumns[$name]));
$this->properties[$name]['type'] = $realType;
}
}
protected function applyNullability(?string $type, bool $isNullable): ?string
{
if (!$type) {
return null;
}
$nullString = null;
// Find instance of:
// A) start of string or non-word character (like space or pipe) followed by 'null|'
// B) '|null' followed by end of string or non-word character (like space or pipe)
// This will find 'or null' instances at the beginning, middle or end of a type string,
// but will exclude solo/pure null instances and null being part of a type's name (e.g. class 'Benull').
if (preg_match('/(?:(?:^|\W)(null\|))|(\|null(?:$|\W))/', $type, $matches) === 1) {
$nullString = array_pop($matches);
}
// Return the current type string if:
// A) the type can be null and the type contains a null instance
// B) the type can not be null and the type does not contain a null instance
if (!($isNullable xor $nullString)) {
return $type;
}
if ($isNullable) {
$type = $this->wrapIntersectionType($type) . '|null';
} else {
$type = str_replace($nullString, '', $type);
}
return $type;
}
/**
* Wraps a bare intersection type in parentheses for correct DNF syntax.
*
* For example, `A&B` becomes `(A&B)` so that adding `|null` produces
* `(A&B)|null` instead of the ambiguous `A&B|null`.
* Types that are already parenthesized or contain union types are returned as-is.
*/
protected function wrapIntersectionType(string $type): string
{
if (str_contains($type, '&') && !str_contains($type, '|') && $type[0] !== '(') {
return '(' . $type . ')';
}
return $type;
}
/**
* Returns the override type for the give type.
*
* @param string $type
* @return string|null
*/
protected function getTypeOverride($type)
{
$typeOverrides = $this->laravel['config']->get('ide-helper.type_overrides', []);
return $typeOverrides[$type] ?? $type;
}
/**
* Load the properties from the database table.
*
* @param Model $model
*
*/
public function getPropertiesFromTable($model)
{
$table = $model->getTable();
$schema = $model->getConnection()->getSchemaBuilder();
$columns = $schema->getColumns($table);
$driverName = $model->getConnection()->getDriverName();
if (!$columns) {
return;
}
$this->setForeignKeys($schema, $table);
foreach ($columns as $column) {
$name = $column['name'];
if (in_array($name, $model->getDates())) {
$type = $this->dateClass;
} else {
// Match types to php equivalent
$type = match ($column['type_name']) {
'tinyint', 'bit',
'integer', 'int', 'int4',
'smallint', 'int2',
'mediumint',
'bigint', 'int8' => 'int',
'boolean', 'bool' => 'bool',
'float', 'real', 'float4',
'double', 'float8' => 'float',
'decimal', 'numeric' => 'numeric',
default => 'string',
};
}
if ($column['nullable']) {
$this->nullableColumns[$name] = true;
}
$this->setProperty(
$name,
$this->getTypeInModel($model, $type),
true,
true,
$column['comment'],
$column['nullable']
);
if ($this->write_model_magic_where) {
$builderClass = $this->write_model_external_builder_methods
? get_class($model->newModelQuery())
: '\Illuminate\Database\Eloquent\Builder';
$this->setMethod(
Str::camel('where_' . $name),
$this->getClassNameInDestinationFile($model, $builderClass)
. '<static>|'
. $this->getClassNameInDestinationFile($model, get_class($model)),
['$value']
);
}
}
}
/**
* @param Model $model
*/
public function getPropertiesFromMethods($model)
{
$reflectionClass = new ReflectionClass($model);
$reflections = $reflectionClass->getMethods();
if ($reflections) {
// Filter out private methods because they can't be used to generate magic properties and HasAttributes'
// methods that resemble mutators but aren't.
$reflections = array_filter($reflections, function (\ReflectionMethod $methodReflection) {
return !$methodReflection->isPrivate() && !(
$methodReflection->getDeclaringClass()->getName() === Model::class && (
$methodReflection->getName() === 'setClassCastableAttribute' ||
$methodReflection->getName() === 'setEnumCastableAttribute'
)
);
});
// https://github.com/barryvdh/laravel-ide-helper/issues/1664
$reflections = array_filter($reflections, function (\ReflectionMethod $methodReflection) {
return !($methodReflection->getName() === 'getUseFactoryAttribute');
});
sort($reflections);
foreach ($reflections as $reflection) {
$type = $this->getReturnTypeFromReflection($reflection);
$isAttribute = is_a($type, '\Illuminate\Database\Eloquent\Casts\Attribute', true);
$method = $reflection->getName();
if (
Str::startsWith($method, 'get') && Str::endsWith($method, 'Attribute') && $method !== 'getAttribute'
) {
//Magic get<name>Attribute
$name = Str::snake(substr($method, 3, -9));
if (!empty($name)) {
$type = $this->getReturnType($reflection);
$type = $this->getTypeInModel($model, $type);
$comment = $this->getCommentFromDocBlock($reflection);
$this->setProperty($name, $type, true, null, $comment);
}
} elseif ($isAttribute) {
$types = $this->getAttributeTypes($model, $reflection);
$type = $this->getTypeInModel($model, $types->get('get') ?: $types->get('set')) ?: null;
$this->setProperty(
Str::snake($method),
$type,
$types->has('get') ?: null,
$types->has('set') ?: null,
$this->getCommentFromDocBlock($reflection)
);
} elseif (
Str::startsWith($method, 'set') &&
Str::endsWith($method, 'Attribute') &&
$method !== 'setAttribute'
) {
//Magic set<name>Attribute
$name = Str::snake(substr($method, 3, -9));
if (!empty($name)) {
$comment = $this->getCommentFromDocBlock($reflection);
$this->setProperty($name, null, null, true, $comment);
}
} elseif (!empty($reflection->getAttributes('Illuminate\Database\Eloquent\Attributes\Scope')) || (Str::startsWith($method, 'scope') && $method !== 'scopeQuery' && $method !== 'scope' && $method !== 'scopes')) {
$scopeUsingAttribute = !empty($reflection->getAttributes('Illuminate\Database\Eloquent\Attributes\Scope'));
//Magic scope<name>Attribute
$name = $scopeUsingAttribute ? $method : Str::camel(substr($method, 5));
if (!empty($name)) {
$comment = $this->getCommentFromDocBlock($reflection);
$args = $this->getParameters($reflection);
//Remove the first ($query) argument
array_shift($args);
$builder = $this->getClassNameInDestinationFile(
$reflection->getDeclaringClass(),
get_class($model->newModelQuery())
);
$modelName = $this->getClassNameInDestinationFile(
new ReflectionClass($model),
get_class($model)
);
$this->setMethod($name, $builder . '<static>|' . $modelName, $args, $comment);
}
} elseif (in_array($method, ['query', 'newQuery', 'newModelQuery'])
) {
if ($this->laravel['config']->get('ide-helper.write_query_methods', true)) {
$builder = $this->getClassNameInDestinationFile($model, get_class($model->newModelQuery()));
$this->setMethod(
$method,
$builder . '<static>|' . $this->getClassNameInDestinationFile($model, get_class($model))
);
}
if ($this->write_model_external_builder_methods) {
$this->writeModelExternalBuilderMethods($model);
}
} elseif (
!method_exists('Illuminate\Database\Eloquent\Model', $method)
&& !Str::startsWith($method, 'get')
) {
//Use reflection to inspect the code, based on Illuminate/Support/SerializableClosure.php
if ($returnType = $reflection->getReturnType()) {
$type = $returnType instanceof ReflectionNamedType
? $returnType->getName()
: (string)$returnType;
} else {
// php 7.x type or fallback to docblock
$type = (string)$this->getReturnTypeFromDocBlock($reflection);
}
$fileName = $reflection->getFileName();
if (!isset($this->fileCache[$fileName])) {
$this->fileCache[$fileName] = new \SplFileObject($fileName);
}
$file = $this->fileCache[$fileName];
$file->seek($reflection->getStartLine() - 1);
$lines = [];
while ($file->key() < $reflection->getEndLine()) {
$lines[] = $file->current();
$file->next();
}
$code = implode('', $lines);
$code = trim(preg_replace('/\s\s+/', '', $code));
$begin = strpos($code, 'function(');
$code = substr($code, $begin, strrpos($code, '}') - $begin + 1);
foreach (
$this->getRelationTypes() as $relation => $impl
) {
$search = '$this->' . $relation . '(';
if (stripos($code, $search) || ltrim($impl, '\\') === ltrim((string)$type, '\\')) {
//Resolve the relation's model to a Relation object.
if ($reflection->getNumberOfParameters()) {
continue;
}
$comment = $this->getCommentFromDocBlock($reflection);
// Adding constraints requires reading model properties which
// can cause errors. Since we don't need constraints we can
// disable them when we fetch the relation to avoid errors.
$relationObj = Relation::noConstraints(function () use ($model, $reflection) {
try {
$methodName = $reflection->getName();
return $model->$methodName();
} catch (Throwable $e) {
$this->warn(sprintf('Error resolving relation model of %s:%s() : %s', get_class($model), $reflection->getName(), $e->getMessage()));
return null;
}
});
if ($relationObj instanceof Relation) {
$relatedModel = $this->getClassNameInDestinationFile(
$model,
get_class($relationObj->getRelated())
);
$relationReturnType = $this->getRelationReturnTypes()[$relation] ?? false;
if (
$relationReturnType === 'many' ||
(
!$relationReturnType &&
str_contains(get_class($relationObj), 'Many')
)
) {
if ($relationObj instanceof BelongsToMany) {
$pivot = get_class($relationObj->newPivot());
if (!in_array($pivot, [Pivot::class, MorphPivot::class])) {
$pivot = $this->getClassNameInDestinationFile($model, $pivot);
if ($existingPivot = ($this->properties[$relationObj->getPivotAccessor()] ?? null)) {
$existingClasses = explode('|', $existingPivot['type']);
if (!in_array($pivot, $existingClasses)) {
array_unshift($existingClasses, $pivot);
}
} else {
// No existing pivot property, so we need to add a null type
$existingClasses = [$pivot, 'null'];
}
// create a union type of all pivot classes
$unionType = implode('|', $existingClasses);
$this->setProperty(
$relationObj->getPivotAccessor(),
$unionType,
true,
false
);
}
}
//Collection or array of models (because Collection is Arrayable)
$relatedClass = '\\' . get_class($relationObj->getRelated());
$collectionClass = $this->getCollectionClass($relatedClass);
$collectionClassNameInModel = $this->getClassNameInDestinationFile(
$model,
$collectionClass
);
$collectionTypeHint = $this->getCollectionTypeHint($collectionClassNameInModel, $relatedModel);
$this->setProperty(
$method,
$collectionTypeHint,
true,
null,
$comment
);
if ($this->write_model_relation_count_properties) {
$this->setProperty(
Str::snake($method) . '_count',
'int|null',
true,
false
// What kind of comments should be added to the relation count here?
);
}
if ($this->write_model_relation_exists_properties) {
$this->setProperty(
Str::snake($method) . '_exists',
'bool|null',
true,
false
// What kind of comments should be added to the relation count here?
);
}
} elseif (
$relationReturnType === 'morphTo' ||
(
!$relationReturnType &&
$relation === 'morphTo'
)
) {
$matches = [];
$returnType = $this->getReturnTypeFromDocBlock($reflection);
if ($returnType !== null) {
preg_match('/MorphTo<(?:contravariant\s+)?(.+?)(?:,|>)/i', $returnType, $matches);
}
// Model isn't specified because relation is polymorphic
$this->setProperty(
$method,
$matches[1] ?? $this->getClassNameInDestinationFile($model, Model::class) . '|\Eloquent',
true,
null,
$comment,
$this->isMorphToRelationNullable($relationObj)
);
} else {
//Single model is returned
$this->setProperty(
$method,
$relatedModel,
true,
null,
$comment,
$this->isRelationNullable($relation, $relationObj)
);
}
}
}
}
}
}
}
}
/**
* Check if the relation is nullable
*
* @param string $relation
* @param Relation $relationObj
*
* @return bool
*/
protected function isRelationNullable(string $relation, Relation $relationObj): bool
{
$reflectionObj = new ReflectionObject($relationObj);
if (in_array($relation, ['hasOne', 'hasOneThrough', 'morphOne'], true)) {
$defaultProp = $reflectionObj->getProperty('withDefault');
return !$defaultProp->getValue($relationObj);
}
if (!$reflectionObj->hasProperty('foreignKey')) {
return false;
}
$fkProp = $reflectionObj->getProperty('foreignKey');
$enforceNullableRelation = $this->laravel['config']->get('ide-helper.enforce_nullable_relationships', true);
foreach (Arr::wrap($fkProp->getValue($relationObj)) as $foreignKey) {
if (isset($this->nullableColumns[$foreignKey])) {
return true;
}
if (!in_array($foreignKey, $this->foreignKeyConstraintsColumns, true)) {
return $enforceNullableRelation;
}
}
if ($this->relatedModelUsesSoftDeletes($relationObj)) {
return true;
}
return false;
}
/**
* Check if the related model uses the SoftDeletes trait
*
* @param Relation $relationObj
*
* @return bool
*/
protected function relatedModelUsesSoftDeletes(Relation $relationObj): bool
{
if (!$this->laravel['config']->get('ide-helper.soft_deletes_force_nullable', true)) {
return false;
}
$relatedModel = $relationObj->getRelated();
return in_array('Illuminate\\Database\\Eloquent\\SoftDeletes', class_uses_recursive($relatedModel));
}
/**
* Check if the morphTo relation is nullable
*
* @param Relation $relationObj
*
* @return bool
*/
protected function isMorphToRelationNullable(Relation $relationObj): bool
{
$reflectionObj = new ReflectionObject($relationObj);
if (!$reflectionObj->hasProperty('foreignKey')) {
return false;
}
$fkProp = $reflectionObj->getProperty('foreignKey');
foreach (Arr::wrap($fkProp->getValue($relationObj)) as $foreignKey) {
if (isset($this->nullableColumns[$foreignKey])) {
return true;
}
}
return false;
}
/**
* @param string $name
* @param string|null $type
* @param bool|null $read
* @param bool|null $write
* @param string|null $comment
* @param bool $nullable
*/
public function setProperty($name, $type = null, $read = null, $write = null, $comment = '', $nullable = false)
{
if (!isset($this->properties[$name])) {
$this->properties[$name] = [];
$this->properties[$name]['type'] = 'mixed';
$this->properties[$name]['read'] = false;
$this->properties[$name]['write'] = false;
$this->properties[$name]['comment'] = (string) $comment;
}
if ($type !== null) {
$newType = $this->getTypeOverride($type);
if ($nullable) {
$newType = $this->wrapIntersectionType($newType) . '|null';
}
$this->properties[$name]['type'] = $newType;
}
if ($read !== null) {
$this->properties[$name]['read'] = $read;
}
if ($write !== null) {
$this->properties[$name]['write'] = $write;
}
}
public function setMethod($name, $type = '', $arguments = [], $comment = '')
{
$methods = array_change_key_case($this->methods, CASE_LOWER);
if (!isset($methods[strtolower($name)])) {
$this->methods[$name] = [];
$this->methods[$name]['type'] = $type;
$this->methods[$name]['arguments'] = $arguments;
$this->methods[$name]['comment'] = $comment;
}
}
public function unsetMethod($name)
{
foreach ($this->methods as $k => $v) {
if (strtolower($k) === strtolower($name)) {
unset($this->methods[$k]);
return;
}
}
}
public function getMethodType(Model $model, string $classType)
{
$modelName = $this->getClassNameInDestinationFile($model, get_class($model));
$builder = $this->getClassNameInDestinationFile($model, $classType);
return $builder . '<static>|' . $modelName;
}
/**
* @param string $class
* @return string
*/
protected function createPhpDocs($class)
{
$reflection = new ReflectionClass($class);
$namespace = $reflection->getNamespaceName();
$classname = $reflection->getShortName();
$originalDoc = $reflection->getDocComment();
$keyword = $this->getClassKeyword($reflection);
$interfaceNames = array_diff_key(
$reflection->getInterfaceNames(),
$reflection->getParentClass()->getInterfaceNames()
);
$phpdoc = new DocBlock($reflection, new Context($namespace));
if ($this->reset) {
$phpdoc->setText(
(new DocBlock($reflection, new Context($namespace)))->getText()
);
foreach ($phpdoc->getTags() as $tag) {
if (
in_array($tag->getName(), ['property', 'property-read', 'property-write', 'method', 'mixin'])
|| ($tag->getName() === 'noinspection' && in_array($tag->getContent(), ['PhpUnnecessaryFullyQualifiedNameInspection', 'PhpFullyQualifiedNameUsageInspection']))
) {
$phpdoc->deleteTag($tag);
}
}
}
$properties = [];
$methods = [];
foreach ($phpdoc->getTags() as $tag) {
$name = $tag->getName();
if ($name == 'property' || $name == 'property-read' || $name == 'property-write') {
$properties[] = $tag->getVariableName();
} elseif ($name == 'method') {
$methods[] = $tag->getMethodName();
}
}
foreach ($this->properties as $name => $property) {
$name = "\$$name";
if ($this->hasCamelCaseModelProperties()) {
$name = Str::camel($name);
}
if (in_array($name, $properties)) {
continue;
}
if ($property['read'] && $property['write']) {
$attr = 'property';
} elseif ($property['write']) {
$attr = 'property-write';
} else {
$attr = 'property-read';
}
$tagLine = trim("@{$attr} {$property['type']} {$name} {$property['comment']}");
$tag = Tag::createInstance($tagLine, $phpdoc);
$phpdoc->appendTag($tag);
}
ksort($this->methods);
foreach ($this->methods as $name => $method) {
if (in_array($name, $methods)) {
continue;
}
$arguments = implode(', ', $method['arguments']);
$tagLine = "@method static {$method['type']} {$name}({$arguments})";
if ($method['comment'] !== '') {
$tagLine .= " {$method['comment']}";
}
$tag = Tag::createInstance($tagLine, $phpdoc);
$phpdoc->appendTag($tag);
}
if ($this->write) {
$eloquentClassNameInModel = $this->getClassNameInDestinationFile($reflection, 'Eloquent');
// remove the already existing tag to prevent duplicates
foreach ($phpdoc->getTagsByName('mixin') as $tag) {
if ($tag->getContent() === $eloquentClassNameInModel) {
$phpdoc->deleteTag($tag);
}
}
$phpdoc->appendTag(Tag::createInstance('@mixin ' . $eloquentClassNameInModel, $phpdoc));
}
if ($this->phpstorm_noinspections) {
/**
* Facades, Eloquent API
* @see https://www.jetbrains.com/help/phpstorm/php-fully-qualified-name-usage.html
*/
$phpdoc->appendTag(Tag::createInstance('@noinspection PhpFullyQualifiedNameUsageInspection', $phpdoc));
/**
* Relations, other models in the same namespace
* @see https://www.jetbrains.com/help/phpstorm/php-unnecessary-fully-qualified-name.html
*/
$phpdoc->appendTag(
Tag::createInstance('@noinspection PhpUnnecessaryFullyQualifiedNameInspection', $phpdoc)
);
}
$serializer = new DocBlockSerializer();
$docComment = $serializer->getDocComment($phpdoc);
$mixinClassName = null;
if ($this->write_mixin) {
$phpdocMixin = new DocBlock($reflection, new Context($namespace));
// remove all mixin tags prefixed with IdeHelper
foreach ($phpdocMixin->getTagsByName('mixin') as $tag) {
if (Str::startsWith($tag->getContent(), 'IdeHelper')) {
$phpdocMixin->deleteTag($tag);
}
}
$mixinClassName = "IdeHelper{$classname}";
$phpdocMixin->appendTag(Tag::createInstance("@mixin {$mixinClassName}", $phpdocMixin));
$mixinDocComment = $serializer->getDocComment($phpdocMixin);
// remove blank lines if there's no text
if (!$phpdocMixin->getText()) {
$mixinDocComment = preg_replace("/\s\*\s*\n/", '', $mixinDocComment);
}
foreach ($phpdoc->getTagsByName('mixin') as $tag) {
if (Str::startsWith($tag->getContent(), 'IdeHelper')) {
$phpdoc->deleteTag($tag);
}
}
$docComment = $serializer->getDocComment($phpdoc);
}
if ($this->write) {
$modelDocComment = $this->write_mixin ? $mixinDocComment : $docComment;
$filename = $reflection->getFileName();
$contents = $this->files->get($filename);
if ($originalDoc) {
$contents = str_replace($originalDoc, $modelDocComment, $contents);
} else {
$replace = "{$modelDocComment}\n";
$pos = strpos($contents, "final class {$classname}") ?: strpos($contents, "class {$classname}");
if ($pos !== false) {
// If PHP 8 attributes (e.g. #[ObservedBy(...)]) precede the class
// declaration, insert the docblock before the first attribute so that
// the resulting order is: docblock → attributes → class.
$before = substr($contents, 0, $pos);
if (preg_match('/((?:#\[.+?\]\s*)+)$/s', $before, $matches)) {
$pos -= strlen($matches[1]);
$replace = "{$modelDocComment}\n";
}
$contents = substr_replace($contents, $replace, $pos, 0);
}
}
if ($this->files->put($filename, $contents)) {
$this->info('Written new phpDocBlock to ' . $filename);
}
}
$classname = $this->write_mixin ? $mixinClassName : $classname;
$allowDynamicAttributes = $this->write_mixin ? "#[\AllowDynamicProperties]\n\t" : '';
$output = "namespace {$namespace}{\n{$docComment}\n\t{$allowDynamicAttributes}{$keyword}class {$classname} ";
if (!$this->write_mixin) {
$output .= "extends \Eloquent ";
if ($interfaceNames) {
$interfaces = implode(', \\', $interfaceNames);
$output .= "imple
gitextract_re81t364/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── 1_Bug_report.md
│ │ ├── 2_Feature_request.md
│ │ └── 3_Support_question.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── dependabot.yaml
│ ├── release-drafter.yml
│ ├── stale.yml
│ └── workflows/
│ ├── composer-normalize.yml
│ ├── fix-code-style.yml
│ ├── release-drafter.yml
│ ├── run-integration-tests.yml
│ ├── run-static-analysis.yml
│ ├── run-tests.yml
│ └── update-changelog.yaml
├── .gitignore
├── .php-cs-fixer.common.php
├── .php-cs-fixer.dist.php
├── .php-cs-fixer.tests.php
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── composer.json
├── config/
│ └── ide-helper.php
├── php-templates/
│ ├── LICENSE.md
│ ├── README.md
│ ├── auth.php
│ ├── configs.php
│ ├── middleware.php
│ ├── routes.php
│ ├── translations.php
│ └── views.php
├── phpstan-baseline.neon
├── phpstan.neon
├── phpunit.xml.dist
├── resources/
│ └── views/
│ ├── helper.php
│ └── meta.php
├── src/
│ ├── Alias.php
│ ├── Console/
│ │ ├── EloquentCommand.php
│ │ ├── GeneratorCommand.php
│ │ ├── MetaCommand.php
│ │ └── ModelsCommand.php
│ ├── Contracts/
│ │ └── ModelHookInterface.php
│ ├── Eloquent.php
│ ├── Generator.php
│ ├── IdeHelperServiceProvider.php
│ ├── Listeners/
│ │ └── GenerateModelHelper.php
│ ├── Macro.php
│ ├── Method.php
│ └── Parsers/
│ └── PhpDocReturnTypeParser.php
└── tests/
├── AliasTest.php
├── Console/
│ ├── EloquentCommandTest.php
│ ├── GeneratorCommand/
│ │ ├── AbstractGeneratorCommand.php
│ │ ├── GenerateEloquentOnly/
│ │ │ └── Test.php
│ │ └── GenerateIdeHelper/
│ │ └── Test.php
│ ├── MetaCommand/
│ │ └── MetaCommandTest.php
│ ├── ModelsCommand/
│ │ ├── AbstractModelsCommand.php
│ │ ├── AdvancedCasts/
│ │ │ ├── Collections/
│ │ │ │ ├── AdvancedCastCollection.php
│ │ │ │ └── AdvancedCastMap.php
│ │ │ ├── Enums/
│ │ │ │ └── AdvancedCastEnum.php
│ │ │ ├── Models/
│ │ │ │ └── AdvancedCast.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── AllowGlobDirectory/
│ │ │ ├── Services/
│ │ │ │ └── Post/
│ │ │ │ └── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── ArrayCastsWithComment/
│ │ │ ├── Models/
│ │ │ │ └── ArrayCastsWithComment.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Attributes/
│ │ │ ├── Models/
│ │ │ │ ├── BackedAttribute.php
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Comment/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── CustomCollection/
│ │ │ ├── Collections/
│ │ │ │ └── SimpleCollection.php
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── CustomDate/
│ │ │ ├── Models/
│ │ │ │ └── CustomDate.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── CustomPhpdocTags/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__testNoSpaceAfterCustomPhpdocTag__1.php
│ │ ├── DnfTypes/
│ │ │ ├── Models/
│ │ │ │ └── DnfTypeModel.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── DoesNotGeneratePhpdocWithExternalEloquentBuilder/
│ │ │ ├── Builders/
│ │ │ │ └── PostExternalQueryBuilder.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── DynamicRelations/
│ │ │ ├── Models/
│ │ │ │ └── Dynamic.php
│ │ │ ├── OtherModels/
│ │ │ │ └── Account.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Factories/
│ │ │ ├── CustomSpace/
│ │ │ │ └── ModelWithCustomNamespaceFactory.php
│ │ │ ├── Factories/
│ │ │ │ ├── ModelWithFactoryFactory.php
│ │ │ │ └── ModelWithNestedFactoryFactory.php
│ │ │ ├── Models/
│ │ │ │ ├── ModelWithCustomNamespace.php
│ │ │ │ ├── ModelWithFactory.php
│ │ │ │ ├── ModelWithNestedFactory.php
│ │ │ │ └── ModelWithoutFactory.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__testFactory__1.php
│ │ ├── GenerateBasicPhpDocWithEnumDefaults/
│ │ │ ├── Enums/
│ │ │ │ └── PostStatus.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateBasicPhpdoc/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateBasicPhpdocCamel/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateBasicPhpdocFinal/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateBasicPhpdocWithEloquentHelper/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenerateMixinCollection/
│ │ │ ├── Models/
│ │ │ │ └── WithCollection.php
│ │ │ ├── NonModels/
│ │ │ │ ├── CollectionModel.php
│ │ │ │ └── NonModel.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpDocWithTypedScopeParameter/
│ │ │ ├── Models/
│ │ │ │ └── Comment.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithExternalEloquentBuilder/
│ │ │ ├── Builders/
│ │ │ │ └── PostExternalQueryBuilder.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithExternalEloquentBuilderWithFqn/
│ │ │ ├── Builders/
│ │ │ │ └── PostExternalQueryBuilder.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithForcedFqn/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithFqn/
│ │ │ ├── Casts/
│ │ │ │ └── CastType.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithFqnInExternalFile/
│ │ │ ├── Builders/
│ │ │ │ └── EMaterialQueryBuilder.php
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GeneratePhpdocWithMixin/
│ │ │ ├── Models/
│ │ │ │ ├── FinalPost.php
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── GenericsSyntaxDisabled/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Getter/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Ignored/
│ │ │ ├── Models/
│ │ │ │ ├── Ignored.php
│ │ │ │ └── NotIgnored.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Interfaces/
│ │ │ ├── Models/
│ │ │ │ └── User.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── LaravelCustomCasts/
│ │ │ ├── Casts/
│ │ │ │ ├── CastableReturnsAnonymousCaster.php
│ │ │ │ ├── CastableReturnsCustomCaster.php
│ │ │ │ ├── CastableWithoutReturnType.php
│ │ │ │ ├── CastedProperty.php
│ │ │ │ ├── CustomCasterWithDocblockReturn.php
│ │ │ │ ├── CustomCasterWithDocblockReturnFqn.php
│ │ │ │ ├── CustomCasterWithNullablePrimitiveReturn.php
│ │ │ │ ├── CustomCasterWithParam.php
│ │ │ │ ├── CustomCasterWithPrimitiveDocblockReturn.php
│ │ │ │ ├── CustomCasterWithPrimitiveReturn.php
│ │ │ │ ├── CustomCasterWithReturnType.php
│ │ │ │ ├── CustomCasterWithStaticReturnType.php
│ │ │ │ ├── CustomCasterWithoutReturnType.php
│ │ │ │ ├── ExtendedSelfCastingCasterWithStaticDocblockReturn.php
│ │ │ │ ├── ExtendedSelfCastingCasterWithThisDocblockReturn.php
│ │ │ │ ├── InboundAttributeCaster.php
│ │ │ │ ├── SelfCastingCasterWithStaticDocblockReturn.php
│ │ │ │ └── SelfCastingCasterWithThisDocblockReturn.php
│ │ │ ├── Models/
│ │ │ │ └── CustomCast.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── MagicWhere/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── ModelHooks/
│ │ │ ├── Hooks/
│ │ │ │ ├── CustomMethod.php
│ │ │ │ ├── CustomProperty.php
│ │ │ │ └── UnsetMethod.php
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── MorphToIntersection/
│ │ │ ├── Models/
│ │ │ │ ├── BaseModel.php
│ │ │ │ ├── CanBeAssigned.php
│ │ │ │ └── MorphToIntersection.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Morphs/
│ │ │ ├── Models/
│ │ │ │ └── Morphs.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── PHPStormNoInspection/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ ├── Test__testNoinspectionNotPresent__1.php
│ │ │ └── Test__testNoinspectionPresent__1.php
│ │ ├── PhpAttributesBeforeClass/
│ │ │ ├── Models/
│ │ │ │ ├── FinalWithNested.php
│ │ │ │ ├── MultipleAttributes.php
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Pivot/
│ │ │ ├── Models/
│ │ │ │ ├── ModelWithPivot.php
│ │ │ │ └── Pivots/
│ │ │ │ ├── CustomPivot.php
│ │ │ │ └── DifferentCustomPivot.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── QueryMethods/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── QueryScopes/
│ │ │ ├── Models/
│ │ │ │ ├── Comment.php
│ │ │ │ ├── Post.php
│ │ │ │ └── PostParent.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── RelationCountProperties/
│ │ │ ├── Models/
│ │ │ │ └── Post.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Relations/
│ │ │ ├── Models/
│ │ │ │ ├── BelongsToVariation.php
│ │ │ │ ├── CompositeBelongsToVariation.php
│ │ │ │ └── Simple.php
│ │ │ ├── ModelsOtherNamespace/
│ │ │ │ └── AnotherModel.php
│ │ │ ├── Test.php
│ │ │ ├── Traits/
│ │ │ │ └── HasTestRelations.php
│ │ │ ├── Types/
│ │ │ │ ├── SampleToAnyMorphedRelationType.php
│ │ │ │ ├── SampleToAnyRelationType.php
│ │ │ │ ├── SampleToBadlyNamedNotManyRelationType.php
│ │ │ │ ├── SampleToManyRelationType.php
│ │ │ │ └── SampleToOneRelationType.php
│ │ │ └── __snapshots__/
│ │ │ ├── Test__testRelationNotNullable__1.php
│ │ │ └── Test__test__1.php
│ │ ├── ResetAndSmartReset/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ ├── Test__testNoReset__1.php
│ │ │ ├── Test__testReset__1.php
│ │ │ └── Test__testSmartReset__1.php
│ │ ├── SimpleCasts/
│ │ │ ├── Models/
│ │ │ │ └── SimpleCast.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── SoftDeletes/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── SoftDeletesRelations/
│ │ │ ├── Models/
│ │ │ │ ├── ModelWithRelations.php
│ │ │ │ ├── NonSoftDeletableModel.php
│ │ │ │ └── SoftDeletableModel.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ ├── Test__testSoftDeletesForceNullableDisabled__1.php
│ │ │ └── Test__test__1.php
│ │ ├── UnionTypes/
│ │ │ ├── Models/
│ │ │ │ └── UnionTypeModel.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ ├── Variadic/
│ │ │ ├── Models/
│ │ │ │ └── Simple.php
│ │ │ ├── Test.php
│ │ │ └── __snapshots__/
│ │ │ └── Test__test__1.php
│ │ └── migrations/
│ │ ├── ____advanced_casts_table.php
│ │ ├── ____backed_attribute_table.php
│ │ ├── ____belongs_to_variation_table.php
│ │ ├── ____custom_casts_table.php
│ │ ├── ____custom_dates_table.php
│ │ ├── ____morphs_table.php
│ │ ├── ____posts_table.php
│ │ ├── ____simple_casts_table.php
│ │ ├── ____simple_table.php
│ │ └── ____soft_deletes_relations_table.php
│ └── __snapshots__/
│ └── EloquentCommandTest__testCommand__1.txt
├── MacroTest.php
├── MethodTest.php
├── RealTimeFacadesTest.php
├── SnapshotPhpDriver.php
├── SnapshotTxtDriver.php
├── TestCase.php
└── stubs/
├── facade-0e0385307adf5db34c7986ecbd11646061356ec8.php
└── facade-9431b04ec1494fc71a1bc848f020044aba2af7b1.php
SYMBOL INDEX (1034 symbols across 248 files)
FILE: php-templates/configs.php
function vsCodeGetConfigValue (line 30) | function vsCodeGetConfigValue($value, $key, $configPaths)
FILE: php-templates/routes.php
function vsCodeGetRouterReflection (line 3) | function vsCodeGetRouterReflection(Illuminate\Routing\Route $route)
FILE: php-templates/translations.php
function vsCodeGetTranslationsFromFile (line 3) | function vsCodeGetTranslationsFromFile(Symfony\Component\Finder\SplFileI...
function vsCodeTranslationValue (line 73) | function vsCodeTranslationValue($key, $value, $file, $lines): ?array
function vscodeCollectTranslations (line 107) | function vscodeCollectTranslations(string $path, ?string $namespace = null)
FILE: php-templates/views.php
function vsCodeFindBladeFiles (line 3) | function vsCodeFindBladeFiles($path)
FILE: src/Alias.php
class Alias (line 29) | class Alias
method __construct (line 65) | public function __construct($config, $alias, $facade, $magicMethods = ...
method addClass (line 113) | public function addClass($classes)
method isValid (line 129) | public function isValid()
method getClasstype (line 139) | public function getClasstype()
method getExtends (line 149) | public function getExtends()
method getExtendsClass (line 159) | public function getExtendsClass()
method getExtendsNamespace (line 169) | public function getExtendsNamespace()
method getParentClass (line 179) | public function getParentClass()
method shouldExtendParentClass (line 187) | public function shouldExtendParentClass()
method getAlias (line 198) | public function getAlias()
method getShortName (line 206) | public function getShortName()
method getNamespace (line 215) | public function getNamespace()
method getMethods (line 225) | public function getMethods()
method detectFake (line 239) | protected function detectFake()
method detectNamespace (line 273) | protected function detectNamespace()
method detectExtendsNamespace (line 287) | protected function detectExtendsNamespace()
method detectParentClass (line 299) | protected function detectParentClass()
method detectClassType (line 311) | protected function detectClassType()
method detectRoot (line 329) | protected function detectRoot(): void
method isTrait (line 365) | protected function isTrait()
method addMagicMethods (line 374) | protected function addMagicMethods()
method detectMethods (line 405) | protected function detectMethods()
method getReturnTypeNormalizers (line 465) | protected function getReturnTypeNormalizers($class)
method getMacroFunction (line 482) | protected function getMacroFunction($macro_func)
method getDocComment (line 501) | public function getDocComment($prefix = "\t\t")
method getPhpDocTemplates (line 527) | public function getPhpDocTemplates($prefix = "\t\t")
method getTemplateNames (line 545) | public function getTemplateNames()
method detectTemplateNames (line 557) | protected function detectTemplateNames()
method removeDuplicateMethodsFromPhpDoc (line 590) | protected function removeDuplicateMethodsFromPhpDoc()
method error (line 610) | protected function error($string)
FILE: src/Console/EloquentCommand.php
class EloquentCommand (line 23) | class EloquentCommand extends Command
method __construct (line 47) | public function __construct(Filesystem $files)
method handle (line 58) | public function handle()
FILE: src/Console/GeneratorCommand.php
class GeneratorCommand (line 28) | class GeneratorCommand extends Command
method __construct (line 62) | public function __construct(
method handle (line 78) | public function handle()
method useMemoryDriver (line 135) | protected function useMemoryDriver()
method getArguments (line 153) | protected function getArguments()
method getOptions (line 169) | protected function getOptions()
FILE: src/Console/MetaCommand.php
class MetaCommand (line 30) | class MetaCommand extends Command
method __construct (line 92) | public function __construct(
method handle (line 108) | public function handle()
method getAbstracts (line 171) | protected function getAbstracts()
method registerClassAutoloadExceptions (line 188) | protected function registerClassAutoloadExceptions(): callable
method getExpectedArgumentSets (line 218) | protected function getExpectedArgumentSets()
method getExpectedArguments (line 233) | protected function getExpectedArguments()
method loadTemplate (line 328) | protected function loadTemplate($name)
method getOptions (line 353) | protected function getOptions()
method getEnv (line 362) | protected function getEnv()
method unregisterClassAutoloadExceptions (line 382) | private function unregisterClassAutoloadExceptions(callable $ourAutolo...
FILE: src/Console/ModelsCommand.php
class ModelsCommand (line 67) | class ModelsCommand extends Command
method __construct (line 154) | public function __construct(Filesystem $files, Repository $config, Vie...
method handle (line 167) | public function handle()
method getArguments (line 243) | protected function getArguments()
method getOptions (line 255) | protected function getOptions()
method generateDocs (line 279) | protected function generateDocs($loadModels, $ignore = '')
method loadModels (line 364) | protected function loadModels()
method castPropertiesType (line 399) | public function castPropertiesType($model)
method applyNullability (line 512) | protected function applyNullability(?string $type, bool $isNullable): ...
method wrapIntersectionType (line 552) | protected function wrapIntersectionType(string $type): string
method getTypeOverride (line 567) | protected function getTypeOverride($type)
method getPropertiesFromTable (line 580) | public function getPropertiesFromTable($model)
method getPropertiesFromMethods (line 647) | public function getPropertiesFromMethods($model)
method isRelationNullable (line 918) | protected function isRelationNullable(string $relation, Relation $rela...
method relatedModelUsesSoftDeletes (line 960) | protected function relatedModelUsesSoftDeletes(Relation $relationObj):...
method isMorphToRelationNullable (line 978) | protected function isMorphToRelationNullable(Relation $relationObj): bool
method setProperty (line 1005) | public function setProperty($name, $type = null, $read = null, $write ...
method setMethod (line 1029) | public function setMethod($name, $type = '', $arguments = [], $comment...
method unsetMethod (line 1041) | public function unsetMethod($name)
method getMethodType (line 1051) | public function getMethodType(Model $model, string $classType)
method createPhpDocs (line 1062) | protected function createPhpDocs($class)
method getParameters (line 1245) | public function getParameters($method)
method getCollectionClass (line 1288) | protected function getCollectionClass($className)
method getCollectionTypeHint (line 1308) | protected function getCollectionTypeHint(string $collectionClassNameIn...
method getRelationTypes (line 1324) | protected function getRelationTypes(): array
method getRelationReturnTypes (line 1335) | protected function getRelationReturnTypes(): array
method hasCamelCaseModelProperties (line 1343) | protected function hasCamelCaseModelProperties()
method getAttributeTypes (line 1351) | protected function getAttributeTypes(Model $model, \ReflectionMethod $...
method getReturnType (line 1393) | protected function getReturnType(\ReflectionMethod $reflection): ?string
method getCommentFromDocBlock (line 1410) | protected function getCommentFromDocBlock(\ReflectionMethod $reflection)
method getReturnTypeFromDocBlock (line 1431) | protected function getReturnTypeFromDocBlock(\ReflectionMethod $reflec...
method getDocBlockContext (line 1451) | protected function getDocBlockContext(\Reflector $reflector): Context
method getReturnTypeFromReflection (line 1476) | protected function getReturnTypeFromReflection(\ReflectionMethod $refl...
method getSoftDeleteMethods (line 1499) | protected function getSoftDeleteMethods($model)
method getFactoryMethods (line 1516) | protected function getFactoryMethods($model)
method getCollectionMethods (line 1549) | protected function getCollectionMethods($model)
method getClassKeyword (line 1566) | protected function getClassKeyword(ReflectionClass $reflection)
method isInboundCast (line 1579) | protected function isInboundCast(string $type): bool
method checkForCastableCasts (line 1584) | protected function checkForCastableCasts(string $type, array $params =...
method checkForCustomLaravelCasts (line 1616) | protected function checkForCustomLaravelCasts(string $type): ?string
method getTypeInModel (line 1643) | protected function getTypeInModel(object $model, ?string $type): ?string
method getClassNameInDestinationFile (line 1656) | protected function getClassNameInDestinationFile(object $model, string...
method getUsedClassNames (line 1679) | protected function getUsedClassNames(ReflectionClass $reflection): array
method writeModelExternalBuilderMethods (line 1690) | protected function writeModelExternalBuilderMethods(Model $model): void
method getParamType (line 1720) | protected function getParamType(\ReflectionMethod $method, \Reflection...
method extractReflectionTypes (line 1802) | protected function extractReflectionTypes(ReflectionType $reflection_t...
method extractUnionTypes (line 1820) | protected function extractUnionTypes(\ReflectionUnionType $union_type)...
method formatIntersectionType (line 1839) | protected function formatIntersectionType(\ReflectionIntersectionType ...
method getReflectionNamedType (line 1849) | protected function getReflectionNamedType(ReflectionNamedType $paramTy...
method runModelHooks (line 1864) | protected function runModelHooks($model): void
method setForeignKeys (line 1885) | protected function setForeignKeys($schema, $table)
FILE: src/Contracts/ModelHookInterface.php
type ModelHookInterface (line 8) | interface ModelHookInterface
method run (line 10) | public function run(ModelsCommand $command, Model $model): void;
FILE: src/Eloquent.php
class Eloquent (line 18) | class Eloquent
method writeEloquentModelHelper (line 29) | public static function writeEloquentModelHelper(Command $command, File...
FILE: src/Generator.php
class Generator (line 23) | class Generator
method __construct (line 45) | public function __construct(
method generate (line 79) | public function generate()
method generateEloquent (line 91) | public function generateEloquent()
method detectHelpers (line 117) | protected function detectHelpers()
method detectDrivers (line 135) | protected function detectDrivers()
method getValidAliases (line 195) | protected function getValidAliases()
method getRealTimeFacades (line 226) | protected function getRealTimeFacades()
method getFullyQualifiedClassNameInFile (line 244) | protected function getFullyQualifiedClassNameInFile(string $path)
method getAliasesByExtendsNamespace (line 269) | protected function getAliasesByExtendsNamespace()
method getAliasesByAliasNamespace (line 287) | protected function getAliasesByAliasNamespace()
method getAliases (line 294) | protected function getAliases()
method error (line 340) | protected function error($string)
method addMacroableClasses (line 354) | protected function addMacroableClasses(Collection $aliases)
method getMacroableClasses (line 375) | protected function getMacroableClasses(Collection $aliases)
FILE: src/IdeHelperServiceProvider.php
class IdeHelperServiceProvider (line 24) | class IdeHelperServiceProvider extends ServiceProvider implements Deferr...
method boot (line 31) | public function boot()
method register (line 59) | public function register()
method provides (line 79) | public function provides()
FILE: src/Listeners/GenerateModelHelper.php
class GenerateModelHelper (line 9) | class GenerateModelHelper
method __construct (line 29) | public function __construct(Artisan $artisan, Config $config)
method handle (line 40) | public function handle(CommandFinished $event)
FILE: src/Macro.php
class Macro (line 10) | class Macro extends Method
method __construct (line 24) | public function __construct(
method setDefaultReturnTypes (line 35) | public static function setDefaultReturnTypes(array $map = [])
method initPhpDoc (line 42) | protected function initPhpDoc($method)
method concatReflectionTypes (line 92) | protected function concatReflectionTypes(?\ReflectionType $type): string
method formatUnionType (line 110) | protected function formatUnionType(\ReflectionUnionType $type): string
method formatIntersectionType (line 127) | protected function formatIntersectionType(\ReflectionIntersectionType ...
method addLocationToPhpDoc (line 136) | protected function addLocationToPhpDoc()
method initClassDefinedProperties (line 165) | protected function initClassDefinedProperties($method, \ReflectionClas...
FILE: src/Method.php
class Method (line 21) | class Method
method __construct (line 54) | public function __construct($method, $class, $methodName = null, $inte...
method initPhpDoc (line 89) | protected function initPhpDoc($method)
method initClassDefinedProperties (line 98) | protected function initClassDefinedProperties($method, \ReflectionClas...
method getDeclaringClass (line 110) | public function getDeclaringClass()
method getRoot (line 120) | public function getRoot()
method isInstanceCall (line 128) | public function isInstanceCall()
method getRootMethodCall (line 136) | public function getRootMethodCall()
method getDocComment (line 151) | public function getDocComment($prefix = "\t\t")
method getName (line 162) | public function getName()
method getRealName (line 172) | public function getRealName()
method getParams (line 183) | public function getParams($implode = true)
method getReturnTag (line 192) | public function getReturnTag($phpdoc = null)
method getParamsWithDefault (line 213) | public function getParamsWithDefault($implode = true)
method normalizeDescription (line 223) | protected function normalizeDescription(DocBlock $phpdoc)
method normalizeParams (line 256) | protected function normalizeParams(DocBlock $phpdoc)
method normalizeReturn (line 279) | protected function normalizeReturn(DocBlock $phpdoc)
method convertKeywords (line 316) | protected function convertKeywords($string)
method shouldReturn (line 330) | public function shouldReturn()
method getParameters (line 345) | public function getParameters($method)
method getInheritDoc (line 381) | protected function getInheritDoc($reflectionMethod)
FILE: src/Parsers/PhpDocReturnTypeParser.php
class PhpDocReturnTypeParser (line 7) | class PhpDocReturnTypeParser
method __construct (line 23) | public function __construct(string $typeAlias, array $namespaceAliases)
method parse (line 32) | public function parse(): string|null
method parseTemplate (line 53) | private function parseTemplate(string|null $template): string
FILE: tests/AliasTest.php
class AliasTest (line 18) | class AliasTest extends TestCase
method testDetectMethodsMacroableMacros (line 23) | public function testDetectMethodsMacroableMacros(): void
method testDetectMethodsEloquentBuilderMacros (line 48) | public function testDetectMethodsEloquentBuilderMacros(): void
method testNoExceptionOnRequiredFakeParameters (line 73) | public function testNoExceptionOnRequiredFakeParameters(): void
method testTemplateNamesAreDetected (line 89) | public function testTemplateNamesAreDetected(): void
method getAliasMacro (line 101) | protected function getAliasMacro(Alias $alias, string $class, string $...
class AliasMock (line 119) | class AliasMock extends Alias
method __construct (line 121) | public function __construct()
method setClasses (line 129) | public function setClasses(array $classes)
method detectMethods (line 134) | public function detectMethods()
method detectFake (line 139) | public function detectFake()
method setFacade (line 144) | public function setFacade(string $facade)
class MockFacade (line 150) | class MockFacade extends Facade
method getFacadeAccessor (line 152) | protected static function getFacadeAccessor()
method fake (line 157) | public static function fake(string $test1, $test2 = null)
FILE: tests/Console/EloquentCommandTest.php
class EloquentCommandTest (line 14) | class EloquentCommandTest extends TestCase
method testCommand (line 16) | public function testCommand()
method getVendorModelFilename (line 61) | private function getVendorModelFilename(): string
FILE: tests/Console/GeneratorCommand/AbstractGeneratorCommand.php
class AbstractGeneratorCommand (line 10) | abstract class AbstractGeneratorCommand extends TestCase
method setUp (line 12) | protected function setUp(): void
method getPackageProviders (line 25) | protected function getPackageProviders($app)
FILE: tests/Console/GeneratorCommand/GenerateEloquentOnly/Test.php
class Test (line 10) | class Test extends AbstractGeneratorCommand
method testGenerator (line 12) | public function testGenerator(): void
FILE: tests/Console/GeneratorCommand/GenerateIdeHelper/Test.php
class Test (line 12) | class Test extends AbstractGeneratorCommand
method testGenerator (line 14) | public function testGenerator(): void
method testFilename (line 35) | public function testFilename(): void
FILE: tests/Console/MetaCommand/MetaCommandTest.php
class MetaCommandTest (line 13) | class MetaCommandTest extends TestCase
method setUp (line 15) | protected function setUp(): void
method testCommand (line 22) | public function testCommand(): void
method testUnregisterAutoloader (line 46) | public function testUnregisterAutoloader(): void
method getPackageProviders (line 83) | protected function getPackageProviders($app)
FILE: tests/Console/ModelsCommand/AbstractModelsCommand.php
class AbstractModelsCommand (line 10) | abstract class AbstractModelsCommand extends TestCase
method setUp (line 12) | protected function setUp(): void
method getPackageProviders (line 28) | protected function getPackageProviders($app)
method getEnvironmentSetUp (line 33) | protected function getEnvironmentSetUp($app)
FILE: tests/Console/ModelsCommand/AdvancedCasts/Collections/AdvancedCastCollection.php
class AdvancedCastCollection (line 9) | class AdvancedCastCollection extends Collection
FILE: tests/Console/ModelsCommand/AdvancedCasts/Collections/AdvancedCastMap.php
class AdvancedCastMap (line 10) | class AdvancedCastMap implements Arrayable, JsonSerializable
method toArray (line 12) | public function toArray(): array
method jsonSerialize (line 17) | public function jsonSerialize(): array
FILE: tests/Console/ModelsCommand/AdvancedCasts/Models/AdvancedCast.php
class AdvancedCast (line 15) | class AdvancedCast extends Model
method casts (line 17) | protected function casts(): array
FILE: tests/Console/ModelsCommand/AdvancedCasts/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/AdvancedCasts/__snapshots__/Test__test__1.php
class AdvancedCast (line 55) | class AdvancedCast extends Model
method casts (line 57) | protected function casts(): array
FILE: tests/Console/ModelsCommand/AllowGlobDirectory/Services/Post/Models/Post.php
class Post (line 9) | class Post extends Model
FILE: tests/Console/ModelsCommand/AllowGlobDirectory/Test.php
class Test (line 10) | final class Test extends AbstractModelsCommand
method setUp (line 15) | protected function setUp(): void
method tearDown (line 22) | protected function tearDown(): void
method test (line 29) | public function test(): void
FILE: tests/Console/ModelsCommand/AllowGlobDirectory/__snapshots__/Test__test__1.php
class Post (line 157) | class Post extends Model
FILE: tests/Console/ModelsCommand/ArrayCastsWithComment/Models/ArrayCastsWithComment.php
class ArrayCastsWithComment (line 24) | class ArrayCastsWithComment extends Model
FILE: tests/Console/ModelsCommand/ArrayCastsWithComment/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/ArrayCastsWithComment/__snapshots__/Test__test__1.php
class ArrayCastsWithComment (line 73) | class ArrayCastsWithComment extends Model
FILE: tests/Console/ModelsCommand/Attributes/Models/BackedAttribute.php
class BackedAttribute (line 10) | class BackedAttribute extends Model
method name (line 12) | protected function name(): Attribute
method nameRead (line 24) | protected function nameRead(): Attribute
method nameWrite (line 33) | protected function nameWrite(): Attribute
method nonBackedSet (line 42) | protected function nonBackedSet(): Attribute
method nonBackedGet (line 51) | protected function nonBackedGet(): Attribute
FILE: tests/Console/ModelsCommand/Attributes/Models/Simple.php
class Simple (line 10) | class Simple extends Model
method name (line 13) | protected function name(): Attribute
method typeHintedGetAndSet (line 27) | protected function typeHintedGetAndSet(): Attribute
method divergingTypeHintedGetAndSet (line 39) | protected function divergingTypeHintedGetAndSet(): Attribute
method typeHintedGet (line 51) | protected function typeHintedGet(): Attribute
method typeHintedSet (line 58) | protected function typeHintedSet(): Attribute
method nonTypeHintedGetAndSet (line 65) | protected function nonTypeHintedGetAndSet(): Attribute
method nonTypeHintedGet (line 77) | protected function nonTypeHintedGet(): Attribute
method nonTypeHintedSet (line 84) | protected function nonTypeHintedSet(): Attribute
method parameterlessSet (line 91) | protected function parameterlessSet(): Attribute
method notAnAttribute (line 106) | protected function notAnAttribute()
FILE: tests/Console/ModelsCommand/Attributes/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/Attributes/__snapshots__/Test__test__1.php
class BackedAttribute (line 26) | class BackedAttribute extends Model
method name (line 28) | protected function name(): Attribute
method nameRead (line 40) | protected function nameRead(): Attribute
method nameWrite (line 49) | protected function nameWrite(): Attribute
method nonBackedSet (line 58) | protected function nonBackedSet(): Attribute
method nonBackedGet (line 67) | protected function nonBackedGet(): Attribute
class Simple (line 102) | class Simple extends Model
method name (line 105) | protected function name(): Attribute
method typeHintedGetAndSet (line 119) | protected function typeHintedGetAndSet(): Attribute
method divergingTypeHintedGetAndSet (line 131) | protected function divergingTypeHintedGetAndSet(): Attribute
method typeHintedGet (line 143) | protected function typeHintedGet(): Attribute
method typeHintedSet (line 150) | protected function typeHintedSet(): Attribute
method nonTypeHintedGetAndSet (line 157) | protected function nonTypeHintedGetAndSet(): Attribute
method nonTypeHintedGet (line 169) | protected function nonTypeHintedGet(): Attribute
method nonTypeHintedSet (line 176) | protected function nonTypeHintedSet(): Attribute
method parameterlessSet (line 183) | protected function parameterlessSet(): Attribute
method notAnAttribute (line 198) | protected function notAnAttribute()
FILE: tests/Console/ModelsCommand/Comment/Models/Simple.php
class Simple (line 12) | class Simple extends Model
method getNotCommentAttribute (line 19) | public function getNotCommentAttribute(): string
method getFakerCommentAttribute (line 28) | public function getFakerCommentAttribute(): string
method getFormatCommentAttribute (line 37) | public function getFormatCommentAttribute(): string
method getFormatCommentLineTwoAttribute (line 47) | public function getFormatCommentLineTwoAttribute(): string
method getManyFormatCommentAttribute (line 57) | public function getManyFormatCommentAttribute(): string
method setFirstNameAttribute (line 65) | public function setFirstNameAttribute($value)
method scopeActive (line 75) | public function scopeActive($query)
method relationHasMany (line 85) | public function relationHasMany(): HasMany
method relationMorphTo (line 94) | public function relationMorphTo(): MorphTo
method relationHasOne (line 103) | public function relationHasOne(): HasOne
method setBothSameNameAttribute (line 111) | public function setBothSameNameAttribute(): void
method getBothSameNameAttribute (line 119) | public function getBothSameNameAttribute(): string
method setBothWithoutGetterCommentAttribute (line 126) | public function setBothWithoutGetterCommentAttribute(): void
method getBothWithoutGetterCommentAttribute (line 133) | public function getBothWithoutGetterCommentAttribute(): string
FILE: tests/Console/ModelsCommand/Comment/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/Comment/__snapshots__/Test__test__1.php
class Simple (line 35) | class Simple extends Model
method getNotCommentAttribute (line 42) | public function getNotCommentAttribute(): string
method getFakerCommentAttribute (line 51) | public function getFakerCommentAttribute(): string
method getFormatCommentAttribute (line 60) | public function getFormatCommentAttribute(): string
method getFormatCommentLineTwoAttribute (line 70) | public function getFormatCommentLineTwoAttribute(): string
method getManyFormatCommentAttribute (line 80) | public function getManyFormatCommentAttribute(): string
method setFirstNameAttribute (line 88) | public function setFirstNameAttribute($value)
method scopeActive (line 98) | public function scopeActive($query)
method relationHasMany (line 108) | public function relationHasMany(): HasMany
method relationMorphTo (line 117) | public function relationMorphTo(): MorphTo
method relationHasOne (line 126) | public function relationHasOne(): HasOne
method setBothSameNameAttribute (line 134) | public function setBothSameNameAttribute(): void
method getBothSameNameAttribute (line 142) | public function getBothSameNameAttribute(): string
method setBothWithoutGetterCommentAttribute (line 149) | public function setBothWithoutGetterCommentAttribute(): void
method getBothWithoutGetterCommentAttribute (line 156) | public function getBothWithoutGetterCommentAttribute(): string
FILE: tests/Console/ModelsCommand/CustomCollection/Collections/SimpleCollection.php
class SimpleCollection (line 9) | class SimpleCollection extends Collection
FILE: tests/Console/ModelsCommand/CustomCollection/Models/Simple.php
class Simple (line 11) | class Simple extends Model
method newCollection (line 13) | public function newCollection(array $models = [])
method relationHasMany (line 18) | public function relationHasMany(): HasMany
FILE: tests/Console/ModelsCommand/CustomCollection/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/CustomCollection/__snapshots__/Test__test__1.php
class Simple (line 24) | class Simple extends Model
method newCollection (line 26) | public function newCollection(array $models = [])
method relationHasMany (line 31) | public function relationHasMany(): HasMany
FILE: tests/Console/ModelsCommand/CustomDate/Models/CustomDate.php
class CustomDate (line 9) | class CustomDate extends Model
FILE: tests/Console/ModelsCommand/CustomDate/Test.php
class Test (line 13) | class Test extends AbstractModelsCommand
method setUp (line 15) | protected function setUp(): void
method tearDown (line 22) | protected function tearDown(): void
method test (line 29) | public function test(): void
FILE: tests/Console/ModelsCommand/CustomDate/__snapshots__/Test__test__1.php
class CustomDate (line 19) | class CustomDate extends Model
FILE: tests/Console/ModelsCommand/CustomPhpdocTags/Models/Simple.php
class Simple (line 17) | class Simple extends Model
FILE: tests/Console/ModelsCommand/CustomPhpdocTags/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method testNoSpaceAfterCustomPhpdocTag (line 18) | public function testNoSpaceAfterCustomPhpdocTag(): void
FILE: tests/Console/ModelsCommand/CustomPhpdocTags/__snapshots__/Test__testNoSpaceAfterCustomPhpdocTag__1.php
class Simple (line 22) | class Simple extends Model
FILE: tests/Console/ModelsCommand/DnfTypes/Models/DnfTypeModel.php
class DnfTypeModel (line 19) | class DnfTypeModel extends Model
method getBasicDnfAttribute (line 28) | public function getBasicDnfAttribute(): (Countable&Iterator)|null
method getIntersectionOrClassAttribute (line 40) | public function getIntersectionOrClassAttribute(): (Countable&Iterator...
method getSingleOrIntersectionOrNullAttribute (line 52) | public function getSingleOrIntersectionOrNullAttribute(): \stdClass|(C...
method getTripleIntersectionAttribute (line 64) | public function getTripleIntersectionAttribute(): (Countable&Iterator&...
method getMultipleIntersectionsAttribute (line 76) | public function getMultipleIntersectionsAttribute(): (Countable&Iterat...
method getMultipleIntersectionsNoNullAttribute (line 88) | public function getMultipleIntersectionsNoNullAttribute(): (Countable&...
method getPureIntersectionAttribute (line 128) | public function getPureIntersectionAttribute(): Countable&Iterator
method scopeWithBasicDnfParam (line 168) | public function scopeWithBasicDnfParam(
method scopeWithComplexDnfParam (line 178) | public function scopeWithComplexDnfParam(
method scopeWithMultipleIntersectionParam (line 188) | public function scopeWithMultipleIntersectionParam(
method scopeWithIntersectionOrPrimitive (line 198) | public function scopeWithIntersectionOrPrimitive(
method scopeWithDnfParamAndReturn (line 212) | public function scopeWithDnfParamAndReturn(
FILE: tests/Console/ModelsCommand/DnfTypes/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/DnfTypes/__snapshots__/Test__test__1.php
class DnfTypeModel (line 35) | class DnfTypeModel extends Model
method getBasicDnfAttribute (line 44) | public function getBasicDnfAttribute(): (Countable&Iterator)|null
method getIntersectionOrClassAttribute (line 56) | public function getIntersectionOrClassAttribute(): (Countable&Iterator...
method getSingleOrIntersectionOrNullAttribute (line 68) | public function getSingleOrIntersectionOrNullAttribute(): \stdClass|(C...
method getTripleIntersectionAttribute (line 80) | public function getTripleIntersectionAttribute(): (Countable&Iterator&...
method getMultipleIntersectionsAttribute (line 92) | public function getMultipleIntersectionsAttribute(): (Countable&Iterat...
method getMultipleIntersectionsNoNullAttribute (line 104) | public function getMultipleIntersectionsNoNullAttribute(): (Countable&...
method getPureIntersectionAttribute (line 144) | public function getPureIntersectionAttribute(): Countable&Iterator
method scopeWithBasicDnfParam (line 184) | public function scopeWithBasicDnfParam(
method scopeWithComplexDnfParam (line 194) | public function scopeWithComplexDnfParam(
method scopeWithMultipleIntersectionParam (line 204) | public function scopeWithMultipleIntersectionParam(
method scopeWithIntersectionOrPrimitive (line 214) | public function scopeWithIntersectionOrPrimitive(
method scopeWithDnfParamAndReturn (line 228) | public function scopeWithDnfParamAndReturn(
FILE: tests/Console/ModelsCommand/DoesNotGeneratePhpdocWithExternalEloquentBuilder/Builders/PostExternalQueryBuilder.php
class PostExternalQueryBuilder (line 9) | class PostExternalQueryBuilder extends Builder
method isActive (line 11) | public function isActive(): self
method isStatus (line 16) | public function isStatus(string $status): self
FILE: tests/Console/ModelsCommand/DoesNotGeneratePhpdocWithExternalEloquentBuilder/Models/Post.php
class Post (line 10) | class Post extends Model
method newEloquentBuilder (line 12) | public function newEloquentBuilder($query): PostExternalQueryBuilder
FILE: tests/Console/ModelsCommand/DoesNotGeneratePhpdocWithExternalEloquentBuilder/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method getEnvironmentSetUp (line 12) | protected function getEnvironmentSetUp($app)
method test (line 19) | public function test(): void
FILE: tests/Console/ModelsCommand/DoesNotGeneratePhpdocWithExternalEloquentBuilder/__snapshots__/Test__test__1.php
class Post (line 162) | class Post extends \Eloquent {}
FILE: tests/Console/ModelsCommand/DynamicRelations/Models/Dynamic.php
class Dynamic (line 12) | class Dynamic extends Model
method regularHasMany (line 18) | public function regularHasMany(): HasMany
method dynamicHasMany (line 24) | public function dynamicHasMany(): HasMany
method dynamicHasOne (line 29) | public function dynamicHasOne(): HasOne
method dynamicBelongsTo (line 34) | public function dynamicBelongsTo(): BelongsTo
FILE: tests/Console/ModelsCommand/DynamicRelations/OtherModels/Account.php
class Account (line 9) | class Account extends Model
FILE: tests/Console/ModelsCommand/DynamicRelations/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/DynamicRelations/__snapshots__/Test__test__1.php
class Dynamic (line 21) | class Dynamic extends Model
method regularHasMany (line 27) | public function regularHasMany(): HasMany
method dynamicHasMany (line 33) | public function dynamicHasMany(): HasMany
method dynamicHasOne (line 38) | public function dynamicHasOne(): HasOne
method dynamicBelongsTo (line 43) | public function dynamicBelongsTo(): BelongsTo
FILE: tests/Console/ModelsCommand/Factories/CustomSpace/ModelWithCustomNamespaceFactory.php
class ModelWithCustomNamespaceFactory (line 10) | class ModelWithCustomNamespaceFactory extends Factory
method definition (line 24) | public function definition()
FILE: tests/Console/ModelsCommand/Factories/Factories/ModelWithFactoryFactory.php
class ModelWithFactoryFactory (line 10) | class ModelWithFactoryFactory extends Factory
method definition (line 24) | public function definition()
FILE: tests/Console/ModelsCommand/Factories/Factories/ModelWithNestedFactoryFactory.php
class ModelWithNestedFactoryFactory (line 10) | class ModelWithNestedFactoryFactory extends Factory
method definition (line 24) | public function definition()
FILE: tests/Console/ModelsCommand/Factories/Models/ModelWithCustomNamespace.php
class ModelWithCustomNamespace (line 11) | class ModelWithCustomNamespace extends Model
method newFactory (line 20) | protected static function newFactory()
FILE: tests/Console/ModelsCommand/Factories/Models/ModelWithFactory.php
class ModelWithFactory (line 10) | class ModelWithFactory extends Model
FILE: tests/Console/ModelsCommand/Factories/Models/ModelWithNestedFactory.php
class ModelWithNestedFactory (line 7) | class ModelWithNestedFactory extends ModelWithFactory
FILE: tests/Console/ModelsCommand/Factories/Models/ModelWithoutFactory.php
class ModelWithoutFactory (line 10) | class ModelWithoutFactory extends Model
FILE: tests/Console/ModelsCommand/Factories/Test.php
class Test (line 13) | class Test extends AbstractModelsCommand
method testFactory (line 15) | public function testFactory(): void
method getFactoryNameResolver (line 31) | public static function getFactoryNameResolver(): Closure
FILE: tests/Console/ModelsCommand/Factories/__snapshots__/Test__testFactory__1.php
class ModelWithCustomNamespace (line 18) | class ModelWithCustomNamespace extends Model
method newFactory (line 27) | protected static function newFactory()
class ModelWithFactory (line 48) | class ModelWithFactory extends Model
class ModelWithNestedFactory (line 65) | class ModelWithNestedFactory extends ModelWithFactory
class ModelWithoutFactory (line 83) | class ModelWithoutFactory extends Model
FILE: tests/Console/ModelsCommand/GenerateBasicPhpDocWithEnumDefaults/Models/Post.php
class Post (line 11) | class Post extends Model
method scopeHasStatus (line 13) | public function scopeHasStatus(Builder $query, ?PostStatus $status = P...
FILE: tests/Console/ModelsCommand/GenerateBasicPhpDocWithEnumDefaults/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GenerateBasicPhpDocWithEnumDefaults/__snapshots__/Test__test__1.php
class Post (line 160) | class Post extends Model
method scopeHasStatus (line 162) | public function scopeHasStatus(Builder $query, ?PostStatus $status = P...
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdoc/Models/Post.php
class Post (line 9) | class Post extends Model
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdoc/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdoc/__snapshots__/Test__test__1.php
class Post (line 157) | class Post extends Model
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdocCamel/Models/Post.php
class Post (line 9) | class Post extends Model
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdocCamel/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method getEnvironmentSetUp (line 12) | protected function getEnvironmentSetUp($app)
method test (line 19) | public function test(): void
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdocCamel/__snapshots__/Test__test__1.php
class Post (line 157) | class Post extends Model
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdocFinal/Models/Post.php
class Post (line 9) | final class Post extends Model
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdocFinal/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdocFinal/__snapshots__/Test__test__1.php
class Post (line 157) | final class Post extends Model
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdocWithEloquentHelper/Models/Post.php
class Post (line 9) | class Post extends Model
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdocWithEloquentHelper/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GenerateBasicPhpdocWithEloquentHelper/__snapshots__/Test__test__1.php
class Post (line 159) | class Post extends Model
FILE: tests/Console/ModelsCommand/GenerateMixinCollection/Models/WithCollection.php
class WithCollection (line 13) | class WithCollection extends Model
method getCollectionAttribute (line 18) | public function getCollectionAttribute(): Collection
method getCollectionWithoutTemplateAttribute (line 26) | public function getCollectionWithoutTemplateAttribute(): Collection
method getCollectionWithoutDocBlockAttribute (line 31) | public function getCollectionWithoutDocBlockAttribute(): Collection
method getCollectionWithNonModelTemplateAttribute (line 39) | public function getCollectionWithNonModelTemplateAttribute(): Collection
method getCollectionWithNestedTemplateAttribute (line 47) | public function getCollectionWithNestedTemplateAttribute(): Collection
FILE: tests/Console/ModelsCommand/GenerateMixinCollection/NonModels/CollectionModel.php
class CollectionModel (line 7) | class CollectionModel
FILE: tests/Console/ModelsCommand/GenerateMixinCollection/NonModels/NonModel.php
class NonModel (line 7) | class NonModel
FILE: tests/Console/ModelsCommand/GenerateMixinCollection/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GenerateMixinCollection/__snapshots__/Test__test__1.php
class WithCollection (line 16) | class WithCollection extends Model
method getCollectionAttribute (line 21) | public function getCollectionAttribute(): Collection
method getCollectionWithoutTemplateAttribute (line 29) | public function getCollectionWithoutTemplateAttribute(): Collection
method getCollectionWithoutDocBlockAttribute (line 34) | public function getCollectionWithoutDocBlockAttribute(): Collection
method getCollectionWithNonModelTemplateAttribute (line 42) | public function getCollectionWithNonModelTemplateAttribute(): Collection
method getCollectionWithNestedTemplateAttribute (line 50) | public function getCollectionWithNestedTemplateAttribute(): Collection
class IdeHelperWithCollection (line 80) | #[\AllowDynamicProperties]
FILE: tests/Console/ModelsCommand/GeneratePhpDocWithTypedScopeParameter/Models/Comment.php
class Comment (line 10) | class Comment extends Model
method scopeTyped01 (line 15) | protected function scopeTyped01(Builder $query, bool $value)
method scopeTyped02 (line 23) | protected function scopeTyped02(Builder $query, bool $value = true)
method scopeTyped03 (line 31) | protected function scopeTyped03(Builder $query, bool $value = false)
method scopeTyped04 (line 39) | protected function scopeTyped04(Builder $query, string $value)
method scopeTyped05 (line 47) | protected function scopeTyped05(Builder $query, string $value = 'dummy...
method scopeTyped06 (line 55) | protected function scopeTyped06(Builder $query, int $value)
method scopeTyped07 (line 63) | protected function scopeTyped07(Builder $query, int $value = 123)
method scopeTyped08 (line 71) | protected function scopeTyped08(Builder $query, int $value = -123)
method scopeTyped09 (line 79) | protected function scopeTyped09(Builder $query, float $value)
method scopeTyped10 (line 87) | protected function scopeTyped10(Builder $query, float $value = 123)
method scopeTyped11 (line 95) | protected function scopeTyped11(Builder $query, float $value = -123)
method scopeTyped12 (line 103) | protected function scopeTyped12(Builder $query, float $value = 1.23)
method scopeTyped13 (line 111) | protected function scopeTyped13(Builder $query, float $value = -1.23)
method scopeTyped14 (line 119) | protected function scopeTyped14(Builder $query, ?bool $value)
method scopeTyped15 (line 127) | protected function scopeTyped15(Builder $query, ?bool $value = true)
method scopeTyped16 (line 135) | protected function scopeTyped16(Builder $query, ?bool $value = false)
method scopeTyped17 (line 143) | protected function scopeTyped17(Builder $query, ?bool $value = null)
method scopeTyped18 (line 151) | protected function scopeTyped18(Builder $query, ?string $value)
method scopeTyped19 (line 159) | protected function scopeTyped19(Builder $query, ?string $value = 'dumm...
method scopeTyped20 (line 167) | protected function scopeTyped20(Builder $query, ?string $value = null)
method scopeTyped21 (line 175) | protected function scopeTyped21(Builder $query, ?int $value)
method scopeTyped22 (line 183) | protected function scopeTyped22(Builder $query, ?int $value = 123)
method scopeTyped23 (line 191) | protected function scopeTyped23(Builder $query, ?int $value = -123)
method scopeTyped24 (line 199) | protected function scopeTyped24(Builder $query, ?int $value = null)
method scopeTyped25 (line 207) | protected function scopeTyped25(Builder $query, ?float $value)
method scopeTyped26 (line 215) | protected function scopeTyped26(Builder $query, ?float $value = 123)
method scopeTyped27 (line 223) | protected function scopeTyped27(Builder $query, ?float $value = -123)
method scopeTyped28 (line 231) | protected function scopeTyped28(Builder $query, ?float $value = 1.23)
method scopeTyped29 (line 239) | protected function scopeTyped29(Builder $query, ?float $value = -1.23)
method scopeTyped30 (line 247) | protected function scopeTyped30(Builder $query, ?float $value = null)
FILE: tests/Console/ModelsCommand/GeneratePhpDocWithTypedScopeParameter/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GeneratePhpDocWithTypedScopeParameter/__snapshots__/Test__test__1.php
class Comment (line 46) | class Comment extends Model
method scopeTyped01 (line 51) | protected function scopeTyped01(Builder $query, bool $value)
method scopeTyped02 (line 59) | protected function scopeTyped02(Builder $query, bool $value = true)
method scopeTyped03 (line 67) | protected function scopeTyped03(Builder $query, bool $value = false)
method scopeTyped04 (line 75) | protected function scopeTyped04(Builder $query, string $value)
method scopeTyped05 (line 83) | protected function scopeTyped05(Builder $query, string $value = 'dummy...
method scopeTyped06 (line 91) | protected function scopeTyped06(Builder $query, int $value)
method scopeTyped07 (line 99) | protected function scopeTyped07(Builder $query, int $value = 123)
method scopeTyped08 (line 107) | protected function scopeTyped08(Builder $query, int $value = -123)
method scopeTyped09 (line 115) | protected function scopeTyped09(Builder $query, float $value)
method scopeTyped10 (line 123) | protected function scopeTyped10(Builder $query, float $value = 123)
method scopeTyped11 (line 131) | protected function scopeTyped11(Builder $query, float $value = -123)
method scopeTyped12 (line 139) | protected function scopeTyped12(Builder $query, float $value = 1.23)
method scopeTyped13 (line 147) | protected function scopeTyped13(Builder $query, float $value = -1.23)
method scopeTyped14 (line 155) | protected function scopeTyped14(Builder $query, ?bool $value)
method scopeTyped15 (line 163) | protected function scopeTyped15(Builder $query, ?bool $value = true)
method scopeTyped16 (line 171) | protected function scopeTyped16(Builder $query, ?bool $value = false)
method scopeTyped17 (line 179) | protected function scopeTyped17(Builder $query, ?bool $value = null)
method scopeTyped18 (line 187) | protected function scopeTyped18(Builder $query, ?string $value)
method scopeTyped19 (line 195) | protected function scopeTyped19(Builder $query, ?string $value = 'dumm...
method scopeTyped20 (line 203) | protected function scopeTyped20(Builder $query, ?string $value = null)
method scopeTyped21 (line 211) | protected function scopeTyped21(Builder $query, ?int $value)
method scopeTyped22 (line 219) | protected function scopeTyped22(Builder $query, ?int $value = 123)
method scopeTyped23 (line 227) | protected function scopeTyped23(Builder $query, ?int $value = -123)
method scopeTyped24 (line 235) | protected function scopeTyped24(Builder $query, ?int $value = null)
method scopeTyped25 (line 243) | protected function scopeTyped25(Builder $query, ?float $value)
method scopeTyped26 (line 251) | protected function scopeTyped26(Builder $query, ?float $value = 123)
method scopeTyped27 (line 259) | protected function scopeTyped27(Builder $query, ?float $value = -123)
method scopeTyped28 (line 267) | protected function scopeTyped28(Builder $query, ?float $value = 1.23)
method scopeTyped29 (line 275) | protected function scopeTyped29(Builder $query, ?float $value = -1.23)
method scopeTyped30 (line 283) | protected function scopeTyped30(Builder $query, ?float $value = null)
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilder/Builders/PostExternalQueryBuilder.php
class PostExternalQueryBuilder (line 10) | class PostExternalQueryBuilder extends Builder
method isActive (line 12) | public function isActive(): self
method isStatus (line 17) | public function isStatus(string $status): self
method isLoadingWith (line 22) | public function isLoadingWith(?string $with): self
method withTheNumber (line 31) | public function withTheNumber($number): self
method withTheNumberDifferently (line 40) | public function withTheNumberDifferently($number): self
method withBool (line 49) | public function withBool($booleanVar): self
method withBoolDifferently (line 58) | public function withBoolDifferently($booleanVar): self
method withBoolTypeHinted (line 63) | public function withBoolTypeHinted(bool $booleanVar): self
method withSomeone (line 72) | public function withSomeone($someone): self
method withMixedOption (line 81) | public function withMixedOption($option): self
method withTestCommand (line 86) | public function withTestCommand(ModelsCommand $testCommand): self
method withNullTestCommand (line 91) | public function withNullTestCommand(?ModelsCommand $testCommand): self
method withNullAndAssignmentTestCommand (line 96) | public function withNullAndAssignmentTestCommand(?ModelsCommand $testC...
method withNullTestCommandInDocBlock (line 105) | public function withNullTestCommandInDocBlock($testCommand): self
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilder/Models/Post.php
class Post (line 10) | class Post extends Model
method newEloquentBuilder (line 12) | public function newEloquentBuilder($query): PostExternalQueryBuilder
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilder/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilder/__snapshots__/Test__test__1.php
class Post (line 176) | class Post extends \Eloquent {}
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilderWithFqn/Builders/PostExternalQueryBuilder.php
class PostExternalQueryBuilder (line 10) | class PostExternalQueryBuilder extends Builder
method isActive (line 12) | public function isActive(): self
method isStatus (line 17) | public function isStatus(string $status): self
method isLoadingWith (line 22) | public function isLoadingWith(?string $with): self
method withTheNumber (line 31) | public function withTheNumber($number): self
method withTheNumberDifferently (line 40) | public function withTheNumberDifferently($number): self
method withBool (line 49) | public function withBool($booleanVar): self
method withBoolDifferently (line 58) | public function withBoolDifferently($booleanVar): self
method withBoolTypeHinted (line 63) | public function withBoolTypeHinted(bool $booleanVar): self
method withSomeone (line 72) | public function withSomeone($someone): self
method withMixedOption (line 81) | public function withMixedOption($option): self
method withTestCommand (line 86) | public function withTestCommand(ModelsCommand $testCommand): self
method withNullTestCommand (line 91) | public function withNullTestCommand(?ModelsCommand $testCommand): self
method withNullAndAssignmentTestCommand (line 96) | public function withNullAndAssignmentTestCommand(?ModelsCommand $testC...
method withNullTestCommandInDocBlock (line 105) | public function withNullTestCommandInDocBlock($testCommand): self
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilderWithFqn/Models/Post.php
class Post (line 10) | class Post extends Model
method newEloquentBuilder (line 12) | public function newEloquentBuilder($query): PostExternalQueryBuilder
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilderWithFqn/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilderWithFqn/__snapshots__/Test__test__1.php
class Post (line 172) | class Post extends Model
method newEloquentBuilder (line 174) | public function newEloquentBuilder($query): PostExternalQueryBuilder
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithForcedFqn/Models/Post.php
class Post (line 11) | class Post extends Model
method posts (line 15) | public function posts(): HasMany
method scopeNull (line 20) | public function scopeNull($query, string $unusedParam)
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithForcedFqn/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method getEnvironmentSetUp (line 12) | protected function getEnvironmentSetUp($app)
method test (line 19) | public function test(): void
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithForcedFqn/__snapshots__/Test__test__1.php
class Post (line 166) | class Post extends Model
method posts (line 170) | public function posts(): HasMany
method scopeNull (line 175) | public function scopeNull($query, string $unusedParam)
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithFqn/Casts/CastType.php
class CastType (line 7) | final class CastType
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithFqn/Models/Post.php
class Post (line 17) | class Post extends Model
method posts (line 37) | public function posts(): HasMany
method scopeNull (line 42) | public function scopeNull($query, string $unusedParam)
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithFqn/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithFqn/__snapshots__/Test__test__1.php
class Post (line 172) | class Post extends Model
method posts (line 192) | public function posts(): HasMany
method scopeNull (line 197) | public function scopeNull($query, string $unusedParam)
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithFqnInExternalFile/Builders/EMaterialQueryBuilder.php
class EMaterialQueryBuilder (line 9) | class EMaterialQueryBuilder extends Builder
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithFqnInExternalFile/Models/Post.php
class Post (line 10) | class Post extends Model
method newEloquentBuilder (line 12) | public function newEloquentBuilder($query): EMaterialQueryBuilder
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithFqnInExternalFile/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithFqnInExternalFile/__snapshots__/Test__test__1.php
class Post (line 162) | class Post extends \Eloquent {}
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models/FinalPost.php
class FinalPost (line 14) | final class FinalPost extends Model
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models/Post.php
class Post (line 14) | class Post extends Model
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/GeneratePhpdocWithMixin/__snapshots__/Test__test__1.php
class FinalPost (line 14) | final class FinalPost extends Model
class Post (line 30) | class Post extends Model
class IdeHelperFinalPost (line 55) | #[\AllowDynamicProperties]
class IdeHelperPost (line 210) | #[\AllowDynamicProperties]
FILE: tests/Console/ModelsCommand/GenericsSyntaxDisabled/Models/Simple.php
class Simple (line 11) | class Simple extends Model
method regularHasMany (line 14) | public function regularHasMany(): HasMany
method regularBelongsToMany (line 19) | public function regularBelongsToMany(): BelongsToMany
FILE: tests/Console/ModelsCommand/GenericsSyntaxDisabled/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method getEnvironmentSetUp (line 12) | protected function getEnvironmentSetUp($app)
method test (line 19) | public function test(): void
FILE: tests/Console/ModelsCommand/GenericsSyntaxDisabled/__snapshots__/Test__test__1.php
class Simple (line 25) | class Simple extends Model
method regularHasMany (line 28) | public function regularHasMany(): HasMany
method regularBelongsToMany (line 33) | public function regularBelongsToMany(): BelongsToMany
FILE: tests/Console/ModelsCommand/Getter/Models/Simple.php
class Simple (line 10) | class Simple extends Model
method getAttributeWithIntReturnPhpdocAttribute (line 15) | public function getAttributeWithIntReturnPhpdocAttribute()
method getAttributeWithIntReturnTypeAttribute (line 19) | public function getAttributeWithIntReturnTypeAttribute(): int
method getAttributeWithIntReturnTypeAndPhpdocAttribute (line 26) | public function getAttributeWithIntReturnTypeAndPhpdocAttribute(): int
method getAttributeWithIntReturnTypeAndButPhpdocStringAttribute (line 33) | public function getAttributeWithIntReturnTypeAndButPhpdocStringAttribu...
method getAttributeWithoutTypeAttribute (line 37) | public function getAttributeWithoutTypeAttribute()
method getAttributeTakesPhpdocLiteralAttribute (line 44) | public function getAttributeTakesPhpdocLiteralAttribute()
method getAttributeReturnTypeIntOrNullAttribute (line 48) | public function getAttributeReturnTypeIntOrNullAttribute(): ?int
method getAttributeReturnsImportedClassAttribute (line 52) | public function getAttributeReturnsImportedClassAttribute(): DateTime
method getAttributeReturnsFqnClassAttribute (line 56) | public function getAttributeReturnsFqnClassAttribute(): \Illuminate\Su...
method getAttributeReturnsArrayAttribute (line 60) | public function getAttributeReturnsArrayAttribute(): array
method getAttributeReturnsNullableArrayAttribute (line 64) | public function getAttributeReturnsNullableArrayAttribute(): ?array
method getAttributeReturnsStdClassAttribute (line 68) | public function getAttributeReturnsStdClassAttribute(): \stdClass
method getAttributeReturnsNullableStdClassAttribute (line 72) | public function getAttributeReturnsNullableStdClassAttribute(): ?\stdC...
method getAttributeReturnsBoolAttribute (line 76) | public function getAttributeReturnsBoolAttribute(): bool
method getAttributeReturnsNullableBoolAttribute (line 80) | public function getAttributeReturnsNullableBoolAttribute(): ?bool
method getAttributeReturnsFloatAttribute (line 84) | public function getAttributeReturnsFloatAttribute(): bool
method getAttributeReturnsNullableFloatAttribute (line 88) | public function getAttributeReturnsNullableFloatAttribute(): ?bool
method getAttributeReturnsCallableAttribute (line 92) | public function getAttributeReturnsCallableAttribute(): callable
method getAttributeReturnsNullableCallableAttribute (line 96) | public function getAttributeReturnsNullableCallableAttribute(): ?callable
method getAttributeReturnsVoidAttribute (line 103) | public function getAttributeReturnsVoidAttribute(): void
method getInvalidAccessModifierAttribute (line 107) | private function getInvalidAccessModifierAttribute()
FILE: tests/Console/ModelsCommand/Getter/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/Getter/__snapshots__/Test__test__1.php
class Simple (line 38) | class Simple extends Model
method getAttributeWithIntReturnPhpdocAttribute (line 43) | public function getAttributeWithIntReturnPhpdocAttribute()
method getAttributeWithIntReturnTypeAttribute (line 47) | public function getAttributeWithIntReturnTypeAttribute(): int
method getAttributeWithIntReturnTypeAndPhpdocAttribute (line 54) | public function getAttributeWithIntReturnTypeAndPhpdocAttribute(): int
method getAttributeWithIntReturnTypeAndButPhpdocStringAttribute (line 61) | public function getAttributeWithIntReturnTypeAndButPhpdocStringAttribu...
method getAttributeWithoutTypeAttribute (line 65) | public function getAttributeWithoutTypeAttribute()
method getAttributeTakesPhpdocLiteralAttribute (line 72) | public function getAttributeTakesPhpdocLiteralAttribute()
method getAttributeReturnTypeIntOrNullAttribute (line 76) | public function getAttributeReturnTypeIntOrNullAttribute(): ?int
method getAttributeReturnsImportedClassAttribute (line 80) | public function getAttributeReturnsImportedClassAttribute(): DateTime
method getAttributeReturnsFqnClassAttribute (line 84) | public function getAttributeReturnsFqnClassAttribute(): \Illuminate\Su...
method getAttributeReturnsArrayAttribute (line 88) | public function getAttributeReturnsArrayAttribute(): array
method getAttributeReturnsNullableArrayAttribute (line 92) | public function getAttributeReturnsNullableArrayAttribute(): ?array
method getAttributeReturnsStdClassAttribute (line 96) | public function getAttributeReturnsStdClassAttribute(): \stdClass
method getAttributeReturnsNullableStdClassAttribute (line 100) | public function getAttributeReturnsNullableStdClassAttribute(): ?\stdC...
method getAttributeReturnsBoolAttribute (line 104) | public function getAttributeReturnsBoolAttribute(): bool
method getAttributeReturnsNullableBoolAttribute (line 108) | public function getAttributeReturnsNullableBoolAttribute(): ?bool
method getAttributeReturnsFloatAttribute (line 112) | public function getAttributeReturnsFloatAttribute(): bool
method getAttributeReturnsNullableFloatAttribute (line 116) | public function getAttributeReturnsNullableFloatAttribute(): ?bool
method getAttributeReturnsCallableAttribute (line 120) | public function getAttributeReturnsCallableAttribute(): callable
method getAttributeReturnsNullableCallableAttribute (line 124) | public function getAttributeReturnsNullableCallableAttribute(): ?callable
method getAttributeReturnsVoidAttribute (line 131) | public function getAttributeReturnsVoidAttribute(): void
method getInvalidAccessModifierAttribute (line 135) | private function getInvalidAccessModifierAttribute()
FILE: tests/Console/ModelsCommand/Ignored/Models/Ignored.php
class Ignored (line 9) | class Ignored extends Model
FILE: tests/Console/ModelsCommand/Ignored/Models/NotIgnored.php
class NotIgnored (line 9) | class NotIgnored extends Model
FILE: tests/Console/ModelsCommand/Ignored/Test.php
class Test (line 11) | class Test extends AbstractModelsCommand
method getEnvironmentSetUp (line 13) | protected function getEnvironmentSetUp($app)
method test (line 22) | public function test(): void
FILE: tests/Console/ModelsCommand/Ignored/__snapshots__/Test__test__1.php
class NotIgnored (line 15) | class NotIgnored extends Model
FILE: tests/Console/ModelsCommand/Interfaces/Models/User.php
class User (line 10) | class User extends Model implements Authenticatable
method getAuthIdentifierName (line 12) | public function getAuthIdentifierName()
method getAuthIdentifier (line 17) | public function getAuthIdentifier()
method getAuthPasswordName (line 22) | public function getAuthPasswordName()
method getAuthPassword (line 27) | public function getAuthPassword()
method getRememberToken (line 32) | public function getRememberToken()
method setRememberToken (line 37) | public function setRememberToken($value)
method getRememberTokenName (line 42) | public function getRememberTokenName()
FILE: tests/Console/ModelsCommand/Interfaces/Test.php
class Test (line 10) | final class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/Interfaces/__snapshots__/Test__test__1.php
class User (line 20) | class User extends \Eloquent implements \Illuminate\Contracts\Auth\Authe...
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableReturnsAnonymousCaster.php
class CastableReturnsAnonymousCaster (line 10) | class CastableReturnsAnonymousCaster implements Castable
method castUsing (line 12) | public static function castUsing(array $arguments)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableReturnsCustomCaster.php
class CastableReturnsCustomCaster (line 9) | class CastableReturnsCustomCaster implements Castable
method castUsing (line 11) | public static function castUsing(array $arguments)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableWithoutReturnType.php
class CastableWithoutReturnType (line 10) | class CastableWithoutReturnType implements Castable
method castUsing (line 12) | public static function castUsing(array $arguments)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastedProperty.php
class CastedProperty (line 7) | class CastedProperty
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithDocblockReturn.php
class CustomCasterWithDocblockReturn (line 9) | class CustomCasterWithDocblockReturn implements CastsAttributes
method get (line 15) | public function get($model, string $key, $value, array $attributes)
method set (line 23) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithDocblockReturnFqn.php
class CustomCasterWithDocblockReturnFqn (line 9) | class CustomCasterWithDocblockReturnFqn implements CastsAttributes
method get (line 15) | public function get($model, string $key, $value, array $attributes)
method set (line 23) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithNullablePrimitiveReturn.php
class CustomCasterWithNullablePrimitiveReturn (line 9) | class CustomCasterWithNullablePrimitiveReturn implements CastsAttributes
method get (line 15) | public function get($model, string $key, $value, array $attributes): ?...
method set (line 23) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithParam.php
class CustomCasterWithParam (line 9) | class CustomCasterWithParam implements CastsAttributes
method __construct (line 11) | public function __construct(string $param)
method get (line 15) | public function get($model, string $key, $value, array $attributes): C...
method set (line 20) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithPrimitiveDocblockReturn.php
class CustomCasterWithPrimitiveDocblockReturn (line 9) | class CustomCasterWithPrimitiveDocblockReturn implements CastsAttributes
method get (line 15) | public function get($model, string $key, $value, array $attributes)
method set (line 23) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithPrimitiveReturn.php
class CustomCasterWithPrimitiveReturn (line 9) | class CustomCasterWithPrimitiveReturn implements CastsAttributes
method get (line 15) | public function get($model, string $key, $value, array $attributes): a...
method set (line 23) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithReturnType.php
class CustomCasterWithReturnType (line 9) | class CustomCasterWithReturnType implements CastsAttributes
method get (line 14) | public function get($model, string $key, $value, array $attributes): C...
method set (line 22) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithStaticReturnType.php
class CustomCasterWithStaticReturnType (line 10) | class CustomCasterWithStaticReturnType implements CastsAttributes
method get (line 12) | public function get(Model $model, string $key, mixed $value, array $at...
method set (line 17) | public function set(Model $model, string $key, mixed $value, array $at...
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithoutReturnType.php
class CustomCasterWithoutReturnType (line 9) | class CustomCasterWithoutReturnType implements CastsAttributes
method get (line 11) | public function get($model, string $key, $value, array $attributes)
method set (line 19) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithStaticDocblockReturn.php
class ExtendedSelfCastingCasterWithStaticDocblockReturn (line 7) | class ExtendedSelfCastingCasterWithStaticDocblockReturn extends SelfCast...
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithThisDocblockReturn.php
class ExtendedSelfCastingCasterWithThisDocblockReturn (line 7) | class ExtendedSelfCastingCasterWithThisDocblockReturn extends SelfCastin...
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/InboundAttributeCaster.php
class InboundAttributeCaster (line 9) | class InboundAttributeCaster implements CastsInboundAttributes
method set (line 11) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/SelfCastingCasterWithStaticDocblockReturn.php
class SelfCastingCasterWithStaticDocblockReturn (line 9) | class SelfCastingCasterWithStaticDocblockReturn implements CastsAttributes
method get (line 14) | public function get($model, string $key, $value, array $attributes)
method set (line 22) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Casts/SelfCastingCasterWithThisDocblockReturn.php
class SelfCastingCasterWithThisDocblockReturn (line 9) | class SelfCastingCasterWithThisDocblockReturn implements CastsAttributes
method get (line 14) | public function get($model, string $key, $value, array $attributes)
method set (line 22) | public function set($model, string $key, $value, array $attributes)
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Models/CustomCast.php
class CustomCast (line 26) | class CustomCast extends Model
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/LaravelCustomCasts/__snapshots__/Test__test__1.php
class CustomCast (line 66) | class CustomCast extends Model
FILE: tests/Console/ModelsCommand/MagicWhere/Models/Post.php
class Post (line 9) | class Post extends Model
FILE: tests/Console/ModelsCommand/MagicWhere/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method getEnvironmentSetUp (line 12) | protected function getEnvironmentSetUp($app)
method test (line 19) | public function test(): void
FILE: tests/Console/ModelsCommand/MagicWhere/__snapshots__/Test__test__1.php
class Post (line 86) | class Post extends Model
FILE: tests/Console/ModelsCommand/ModelHooks/Hooks/CustomMethod.php
class CustomMethod (line 12) | class CustomMethod implements ModelHookInterface
method run (line 14) | public function run(ModelsCommand $command, Model $model): void
FILE: tests/Console/ModelsCommand/ModelHooks/Hooks/CustomProperty.php
class CustomProperty (line 11) | class CustomProperty implements ModelHookInterface
method run (line 13) | public function run(ModelsCommand $command, Model $model): void
FILE: tests/Console/ModelsCommand/ModelHooks/Hooks/UnsetMethod.php
class UnsetMethod (line 11) | class UnsetMethod implements ModelHookInterface
method run (line 13) | public function run(ModelsCommand $command, Model $model): void
FILE: tests/Console/ModelsCommand/ModelHooks/Models/Simple.php
class Simple (line 9) | class Simple extends Model
FILE: tests/Console/ModelsCommand/ModelHooks/Test.php
class Test (line 13) | class Test extends AbstractModelsCommand
method getEnvironmentSetUp (line 15) | protected function getEnvironmentSetUp($app)
method test (line 33) | public function test(): void
FILE: tests/Console/ModelsCommand/ModelHooks/__snapshots__/Test__test__1.php
class Simple (line 18) | class Simple extends Model
FILE: tests/Console/ModelsCommand/MorphToIntersection/Models/BaseModel.php
class BaseModel (line 9) | abstract class BaseModel extends Model
FILE: tests/Console/ModelsCommand/MorphToIntersection/Models/CanBeAssigned.php
type CanBeAssigned (line 7) | interface CanBeAssigned
FILE: tests/Console/ModelsCommand/MorphToIntersection/Models/MorphToIntersection.php
class MorphToIntersection (line 10) | class MorphToIntersection extends Model
method assigneeWithParens (line 15) | public function assigneeWithParens(): MorphTo
method assigneeWithoutParens (line 21) | public function assigneeWithoutParens(): MorphTo
method nonNullableAssignee (line 27) | public function nonNullableAssignee(): MorphTo
FILE: tests/Console/ModelsCommand/MorphToIntersection/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/MorphToIntersection/__snapshots__/Test__test__1.php
class MorphToIntersection (line 27) | class MorphToIntersection extends Model
method assigneeWithParens (line 32) | public function assigneeWithParens(): MorphTo
method assigneeWithoutParens (line 38) | public function assigneeWithoutParens(): MorphTo
method nonNullableAssignee (line 44) | public function nonNullableAssignee(): MorphTo
FILE: tests/Console/ModelsCommand/Morphs/Models/Morphs.php
class Morphs (line 10) | class Morphs extends Model
method relationMorphTo (line 12) | public function relationMorphTo(): MorphTo
method nullableRelationMorphTo (line 17) | public function nullableRelationMorphTo(): MorphTo
FILE: tests/Console/ModelsCommand/Morphs/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/Morphs/__snapshots__/Test__test__1.php
class Morphs (line 26) | class Morphs extends Model
method relationMorphTo (line 28) | public function relationMorphTo(): MorphTo
method nullableRelationMorphTo (line 33) | public function nullableRelationMorphTo(): MorphTo
FILE: tests/Console/ModelsCommand/PHPStormNoInspection/Models/Simple.php
class Simple (line 9) | class Simple extends Model
FILE: tests/Console/ModelsCommand/PHPStormNoInspection/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method testNoinspectionNotPresent (line 12) | public function testNoinspectionNotPresent(): void
method testNoinspectionPresent (line 25) | public function testNoinspectionPresent(): void
FILE: tests/Console/ModelsCommand/PHPStormNoInspection/__snapshots__/Test__testNoinspectionNotPresent__1.php
class Simple (line 17) | class Simple extends Model
FILE: tests/Console/ModelsCommand/PHPStormNoInspection/__snapshots__/Test__testNoinspectionPresent__1.php
class Simple (line 19) | class Simple extends Model
FILE: tests/Console/ModelsCommand/PhpAttributesBeforeClass/Models/FinalWithNested.php
class FinalWithNested (line 10) | #[ObservedByStub([StubObserver::class])]
FILE: tests/Console/ModelsCommand/PhpAttributesBeforeClass/Models/MultipleAttributes.php
class MultipleAttributes (line 10) | #[\AllowDynamicProperties]
FILE: tests/Console/ModelsCommand/PhpAttributesBeforeClass/Models/Simple.php
class Simple (line 9) | #[\AllowDynamicProperties]
FILE: tests/Console/ModelsCommand/PhpAttributesBeforeClass/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/PhpAttributesBeforeClass/__snapshots__/Test__test__1.php
class FinalWithNested (line 18) | #[ObservedByStub([StubObserver::class])]
class MultipleAttributes (line 40) | #[\AllowDynamicProperties]
class Simple (line 62) | #[\AllowDynamicProperties]
FILE: tests/Console/ModelsCommand/Pivot/Models/ModelWithPivot.php
class ModelWithPivot (line 11) | class ModelWithPivot extends Model
method relationWithCustomPivot (line 13) | public function relationWithCustomPivot()
method relationWithDifferentCustomPivot (line 21) | public function relationWithDifferentCustomPivot()
method relationCustomPivotUsingSameAccessor (line 30) | public function relationCustomPivotUsingSameAccessor()
method relationCustomPivotUsingSameAccessorAndClass (line 36) | public function relationCustomPivotUsingSameAccessorAndClass()
method relationWithDifferentCustomPivotUsingSameAccessor (line 42) | public function relationWithDifferentCustomPivotUsingSameAccessor()
FILE: tests/Console/ModelsCommand/Pivot/Models/Pivots/CustomPivot.php
class CustomPivot (line 9) | class CustomPivot extends Pivot
FILE: tests/Console/ModelsCommand/Pivot/Models/Pivots/DifferentCustomPivot.php
class DifferentCustomPivot (line 9) | class DifferentCustomPivot extends Pivot
FILE: tests/Console/ModelsCommand/Pivot/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/Pivot/__snapshots__/Test__test__1.php
class ModelWithPivot (line 35) | class ModelWithPivot extends Model
method relationWithCustomPivot (line 37) | public function relationWithCustomPivot()
method relationWithDifferentCustomPivot (line 45) | public function relationWithDifferentCustomPivot()
method relationCustomPivotUsingSameAccessor (line 54) | public function relationCustomPivotUsingSameAccessor()
method relationCustomPivotUsingSameAccessorAndClass (line 60) | public function relationCustomPivotUsingSameAccessorAndClass()
method relationWithDifferentCustomPivotUsingSameAccessor (line 66) | public function relationWithDifferentCustomPivotUsingSameAccessor()
class CustomPivot (line 86) | class CustomPivot extends Pivot
class DifferentCustomPivot (line 103) | class DifferentCustomPivot extends Pivot
FILE: tests/Console/ModelsCommand/QueryMethods/Models/Post.php
class Post (line 9) | class Post extends Model
FILE: tests/Console/ModelsCommand/QueryMethods/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method getEnvironmentSetUp (line 12) | protected function getEnvironmentSetUp($app)
method test (line 19) | public function test(): void
FILE: tests/Console/ModelsCommand/QueryMethods/__snapshots__/Test__test__1.php
class Post (line 154) | class Post extends Model
FILE: tests/Console/ModelsCommand/QueryScopes/Models/Comment.php
class Comment (line 11) | class Comment extends Model
method local (line 18) | #[Scope]
method scopeSystem (line 29) | protected function scopeSystem(Builder $query): void
FILE: tests/Console/ModelsCommand/QueryScopes/Models/Post.php
class Post (line 7) | class Post extends PostParent
method scopePublic (line 9) | public function scopePublic($query)
FILE: tests/Console/ModelsCommand/QueryScopes/Models/PostParent.php
class PostParent (line 9) | class PostParent extends Model
method scopeActive (line 11) | public function scopeActive($query)
FILE: tests/Console/ModelsCommand/QueryScopes/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/QueryScopes/__snapshots__/Test__test__1.php
class Comment (line 19) | class Comment extends Model
method local (line 26) | #[Scope]
method scopeSystem (line 37) | protected function scopeSystem(Builder $query): void
class Post (line 198) | class Post extends PostParent
method scopePublic (line 200) | public function scopePublic($query)
class PostParent (line 220) | class PostParent extends Model
method scopeActive (line 222) | public function scopeActive($query)
FILE: tests/Console/ModelsCommand/RelationCountProperties/Models/Post.php
class Post (line 10) | class Post extends Model
method relationHasMany (line 12) | public function relationHasMany(): HasMany
FILE: tests/Console/ModelsCommand/RelationCountProperties/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method getEnvironmentSetUp (line 12) | protected function getEnvironmentSetUp($app)
method test (line 20) | public function test(): void
FILE: tests/Console/ModelsCommand/RelationCountProperties/__snapshots__/Test__test__1.php
class Post (line 159) | class Post extends Model
method relationHasMany (line 161) | public function relationHasMany(): HasMany
FILE: tests/Console/ModelsCommand/Relations/Models/BelongsToVariation.php
class BelongsToVariation (line 10) | class BelongsToVariation extends Model
method notNullColumnWithForeignKeyConstraint (line 12) | public function notNullColumnWithForeignKeyConstraint(): BelongsTo
method notNullColumnWithNoForeignKeyConstraint (line 17) | public function notNullColumnWithNoForeignKeyConstraint(): BelongsTo
method nullableColumnWithForeignKeyConstraint (line 22) | public function nullableColumnWithForeignKeyConstraint(): BelongsTo
method nullableColumnWithNoForeignKeyConstraint (line 27) | public function nullableColumnWithNoForeignKeyConstraint(): BelongsTo
FILE: tests/Console/ModelsCommand/Relations/Models/CompositeBelongsToVariation.php
class CompositeBelongsToVariation (line 10) | class CompositeBelongsToVariation extends Model
method bothNonNullableWithForeignKeyConstraint (line 14) | public function bothNonNullableWithForeignKeyConstraint(): BelongsTo
method nonNullableMixedWithoutForeignKeyConstraint (line 24) | public function nonNullableMixedWithoutForeignKeyConstraint(): BelongsTo
method nullableMixedWithForeignKeyConstraint (line 33) | public function nullableMixedWithForeignKeyConstraint(): BelongsTo
FILE: tests/Console/ModelsCommand/Relations/Models/Simple.php
class Simple (line 19) | class Simple extends Model
method relationHasMany (line 24) | public function relationHasMany(): HasMany
method relationHasOne (line 29) | public function relationHasOne(): HasOne
method relationHasOneWithDefault (line 34) | public function relationHasOneWithDefault(): HasOne
method relationBelongsTo (line 39) | public function relationBelongsTo(): BelongsTo
method relationBelongsToMany (line 44) | public function relationBelongsToMany(): BelongsToMany
method relationBelongsToManyWithSub (line 49) | public function relationBelongsToManyWithSub(): BelongsToMany
method relationBelongsToManyWithSubAnother (line 54) | public function relationBelongsToManyWithSubAnother(): BelongsToMany
method relationMorphTo (line 59) | public function relationMorphTo(): MorphTo
method relationMorphOne (line 64) | public function relationMorphOne(): MorphOne
method relationMorphMany (line 69) | public function relationMorphMany(): MorphMany
method relationMorphedByMany (line 74) | public function relationMorphedByMany(): MorphToMany
method relationBelongsToInAnotherNamespace (line 81) | public function relationBelongsToInAnotherNamespace(): BelongsTo
method relationBelongsToSameNameAsColumn (line 86) | public function relationBelongsToSameNameAsColumn(): BelongsTo
method relationSampleToManyRelationType (line 91) | public function relationSampleToManyRelationType()
method relationSampleRelationType (line 96) | public function relationSampleRelationType()
method relationSampleToAnyRelationType (line 101) | public function relationSampleToAnyRelationType()
method relationSampleToAnyMorphedRelationType (line 106) | public function relationSampleToAnyMorphedRelationType()
method relationSampleToBadlyNamedNotManyRelation (line 111) | public function relationSampleToBadlyNamedNotManyRelation()
FILE: tests/Console/ModelsCommand/Relations/ModelsOtherNamespace/AnotherModel.php
class AnotherModel (line 9) | class AnotherModel extends Model
FILE: tests/Console/ModelsCommand/Relations/Test.php
class Test (line 16) | class Test extends AbstractModelsCommand
method setUp (line 18) | protected function setUp(): void
method test (line 37) | public function test(): void
method testRelationNotNullable (line 50) | public function testRelationNotNullable(): void
FILE: tests/Console/ModelsCommand/Relations/Traits/HasTestRelations.php
type HasTestRelations (line 13) | trait HasTestRelations
method testToOneRelation (line 15) | public function testToOneRelation($related)
method testToManyRelation (line 21) | public function testToManyRelation($related)
method testToAnyRelation (line 27) | public function testToAnyRelation($related)
method testToAnyMorphedRelation (line 33) | public function testToAnyMorphedRelation($related)
method testToBadlyNamedNotManyRelation (line 39) | public function testToBadlyNamedNotManyRelation($related)
FILE: tests/Console/ModelsCommand/Relations/Types/SampleToAnyMorphedRelationType.php
class SampleToAnyMorphedRelationType (line 10) | class SampleToAnyMorphedRelationType extends Relation
method addConstraints (line 12) | public function addConstraints()
method addEagerConstraints (line 17) | public function addEagerConstraints(array $models)
method initRelation (line 22) | public function initRelation(array $models, $relation)
method match (line 27) | public function match(array $models, Collection $results, $relation)
method getResults (line 32) | public function getResults()
FILE: tests/Console/ModelsCommand/Relations/Types/SampleToAnyRelationType.php
class SampleToAnyRelationType (line 10) | class SampleToAnyRelationType extends Relation
method addConstraints (line 12) | public function addConstraints()
method addEagerConstraints (line 17) | public function addEagerConstraints(array $models)
method initRelation (line 22) | public function initRelation(array $models, $relation)
method match (line 27) | public function match(array $models, Collection $results, $relation)
method getResults (line 32) | public function getResults()
FILE: tests/Console/ModelsCommand/Relations/Types/SampleToBadlyNamedNotManyRelationType.php
class SampleToBadlyNamedNotManyRelationType (line 19) | class SampleToBadlyNamedNotManyRelationType extends Relation
method addConstraints (line 23) | public function addConstraints()
method addEagerConstraints (line 28) | public function addEagerConstraints(array $models)
method initRelation (line 33) | public function initRelation(array $models, $relation)
method match (line 38) | public function match(array $models, Collection $results, $relation)
method getResults (line 43) | public function getResults()
method newRelatedInstanceFor (line 48) | protected function newRelatedInstanceFor(Model $parent)
FILE: tests/Console/ModelsCommand/Relations/Types/SampleToManyRelationType.php
class SampleToManyRelationType (line 10) | class SampleToManyRelationType extends Relation
method addConstraints (line 12) | public function addConstraints()
method addEagerConstraints (line 17) | public function addEagerConstraints(array $models)
method initRelation (line 22) | public function initRelation(array $models, $relation)
method match (line 27) | public function match(array $models, Collection $results, $relation)
method getResults (line 32) | public function getResults()
FILE: tests/Console/ModelsCommand/Relations/Types/SampleToOneRelationType.php
class SampleToOneRelationType (line 19) | class SampleToOneRelationType extends Relation
method addConstraints (line 23) | public function addConstraints()
method addEagerConstraints (line 28) | public function addEagerConstraints(array $models)
method initRelation (line 33) | public function initRelation(array $models, $relation)
method match (line 38) | public function match(array $models, Collection $results, $relation)
method getResults (line 43) | public function getResults()
method newRelatedInstanceFor (line 48) | protected function newRelatedInstanceFor(Model $parent)
FILE: tests/Console/ModelsCommand/Relations/__snapshots__/Test__testRelationNotNullable__1.php
class BelongsToVariation (line 30) | class BelongsToVariation extends Model
method notNullColumnWithForeignKeyConstraint (line 32) | public function notNullColumnWithForeignKeyConstraint(): BelongsTo
method notNullColumnWithNoForeignKeyConstraint (line 37) | public function notNullColumnWithNoForeignKeyConstraint(): BelongsTo
method nullableColumnWithForeignKeyConstraint (line 42) | public function nullableColumnWithForeignKeyConstraint(): BelongsTo
method nullableColumnWithNoForeignKeyConstraint (line 47) | public function nullableColumnWithNoForeignKeyConstraint(): BelongsTo
class CompositeBelongsToVariation (line 80) | class CompositeBelongsToVariation extends Model
method bothNonNullableWithForeignKeyConstraint (line 84) | public function bothNonNullableWithForeignKeyConstraint(): BelongsTo
method nonNullableMixedWithoutForeignKeyConstraint (line 94) | public function nonNullableMixedWithoutForeignKeyConstraint(): BelongsTo
method nullableMixedWithForeignKeyConstraint (line 103) | public function nullableMixedWithForeignKeyConstraint(): BelongsTo
class Simple (line 172) | class Simple extends Model
method relationHasMany (line 177) | public function relationHasMany(): HasMany
method relationHasOne (line 182) | public function relationHasOne(): HasOne
method relationHasOneWithDefault (line 187) | public function relationHasOneWithDefault(): HasOne
method relationBelongsTo (line 192) | public function relationBelongsTo(): BelongsTo
method relationBelongsToMany (line 197) | public function relationBelongsToMany(): BelongsToMany
method relationBelongsToManyWithSub (line 202) | public function relationBelongsToManyWithSub(): BelongsToMany
method relationBelongsToManyWithSubAnother (line 207) | public function relationBelongsToManyWithSubAnother(): BelongsToMany
method relationMorphTo (line 212) | public function relationMorphTo(): MorphTo
method relationMorphOne (line 217) | public function relationMorphOne(): MorphOne
method relationMorphMany (line 222) | public function relationMorphMany(): MorphMany
method relationMorphedByMany (line 227) | public function relationMorphedByMany(): MorphToMany
method relationBelongsToInAnotherNamespace (line 234) | public function relationBelongsToInAnotherNamespace(): BelongsTo
method relationBelongsToSameNameAsColumn (line 239) | public function relationBelongsToSameNameAsColumn(): BelongsTo
method relationSampleToManyRelationType (line 244) | public function relationSampleToManyRelationType()
method relationSampleRelationType (line 249) | public function relationSampleRelationType()
method relationSampleToAnyRelationType (line 254) | public function relationSampleToAnyRelationType()
method relationSampleToAnyMorphedRelationType (line 259) | public function relationSampleToAnyMorphedRelationType()
method relationSampleToBadlyNamedNotManyRelation (line 264) | public function relationSampleToBadlyNamedNotManyRelation()
FILE: tests/Console/ModelsCommand/Relations/__snapshots__/Test__test__1.php
class BelongsToVariation (line 30) | class BelongsToVariation extends Model
method notNullColumnWithForeignKeyConstraint (line 32) | public function notNullColumnWithForeignKeyConstraint(): BelongsTo
method notNullColumnWithNoForeignKeyConstraint (line 37) | public function notNullColumnWithNoForeignKeyConstraint(): BelongsTo
method nullableColumnWithForeignKeyConstraint (line 42) | public function nullableColumnWithForeignKeyConstraint(): BelongsTo
method nullableColumnWithNoForeignKeyConstraint (line 47) | public function nullableColumnWithNoForeignKeyConstraint(): BelongsTo
class CompositeBelongsToVariation (line 80) | class CompositeBelongsToVariation extends Model
method bothNonNullableWithForeignKeyConstraint (line 84) | public function bothNonNullableWithForeignKeyConstraint(): BelongsTo
method nonNullableMixedWithoutForeignKeyConstraint (line 94) | public function nonNullableMixedWithoutForeignKeyConstraint(): BelongsTo
method nullableMixedWithForeignKeyConstraint (line 103) | public function nullableMixedWithForeignKeyConstraint(): BelongsTo
class Simple (line 172) | class Simple extends Model
method relationHasMany (line 177) | public function relationHasMany(): HasMany
method relationHasOne (line 182) | public function relationHasOne(): HasOne
method relationHasOneWithDefault (line 187) | public function relationHasOneWithDefault(): HasOne
method relationBelongsTo (line 192) | public function relationBelongsTo(): BelongsTo
method relationBelongsToMany (line 197) | public function relationBelongsToMany(): BelongsToMany
method relationBelongsToManyWithSub (line 202) | public function relationBelongsToManyWithSub(): BelongsToMany
method relationBelongsToManyWithSubAnother (line 207) | public function relationBelongsToManyWithSubAnother(): BelongsToMany
method relationMorphTo (line 212) | public function relationMorphTo(): MorphTo
method relationMorphOne (line 217) | public function relationMorphOne(): MorphOne
method relationMorphMany (line 222) | public function relationMorphMany(): MorphMany
method relationMorphedByMany (line 227) | public function relationMorphedByMany(): MorphToMany
method relationBelongsToInAnotherNamespace (line 234) | public function relationBelongsToInAnotherNamespace(): BelongsTo
method relationBelongsToSameNameAsColumn (line 239) | public function relationBelongsToSameNameAsColumn(): BelongsTo
method relationSampleToManyRelationType (line 244) | public function relationSampleToManyRelationType()
method relationSampleRelationType (line 249) | public function relationSampleRelationType()
method relationSampleToAnyRelationType (line 254) | public function relationSampleToAnyRelationType()
method relationSampleToAnyMorphedRelationType (line 259) | public function relationSampleToAnyMorphedRelationType()
method relationSampleToBadlyNamedNotManyRelation (line 264) | public function relationSampleToBadlyNamedNotManyRelation()
FILE: tests/Console/ModelsCommand/ResetAndSmartReset/Models/Simple.php
class Simple (line 20) | class Simple extends Model
FILE: tests/Console/ModelsCommand/ResetAndSmartReset/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method testNoReset (line 12) | public function testNoReset(): void
method testReset (line 25) | public function testReset(): void
FILE: tests/Console/ModelsCommand/ResetAndSmartReset/__snapshots__/Test__testNoReset__1.php
class Simple (line 25) | class Simple extends Model
FILE: tests/Console/ModelsCommand/ResetAndSmartReset/__snapshots__/Test__testReset__1.php
class Simple (line 21) | class Simple extends Model
FILE: tests/Console/ModelsCommand/ResetAndSmartReset/__snapshots__/Test__testSmartReset__1.php
class Simple (line 19) | class Simple extends Model
FILE: tests/Console/ModelsCommand/SimpleCasts/Models/SimpleCast.php
class SimpleCast (line 9) | class SimpleCast extends Model
FILE: tests/Console/ModelsCommand/SimpleCasts/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/SimpleCasts/__snapshots__/Test__test__1.php
class SimpleCast (line 73) | class SimpleCast extends Model
FILE: tests/Console/ModelsCommand/SoftDeletes/Models/Simple.php
class Simple (line 10) | class Simple extends Model
FILE: tests/Console/ModelsCommand/SoftDeletes/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/SoftDeletes/__snapshots__/Test__test__1.php
class Simple (line 21) | class Simple extends Model
FILE: tests/Console/ModelsCommand/SoftDeletesRelations/Models/ModelWithRelations.php
class ModelWithRelations (line 11) | class ModelWithRelations extends Model
method softDeletable (line 15) | public function softDeletable(): BelongsTo
method nonSoftDeletable (line 20) | public function nonSoftDeletable(): BelongsTo
method softDeletableHasOne (line 25) | public function softDeletableHasOne(): HasOne
method nonSoftDeletableHasOne (line 30) | public function nonSoftDeletableHasOne(): HasOne
FILE: tests/Console/ModelsCommand/SoftDeletesRelations/Models/NonSoftDeletableModel.php
class NonSoftDeletableModel (line 9) | class NonSoftDeletableModel extends Model
FILE: tests/Console/ModelsCommand/SoftDeletesRelations/Models/SoftDeletableModel.php
class SoftDeletableModel (line 10) | class SoftDeletableModel extends Model
FILE: tests/Console/ModelsCommand/SoftDeletesRelations/Test.php
class Test (line 11) | class Test extends AbstractModelsCommand
method test (line 13) | public function test(): void
method testSoftDeletesForceNullableDisabled (line 26) | public function testSoftDeletesForceNullableDisabled(): void
FILE: tests/Console/ModelsCommand/SoftDeletesRelations/__snapshots__/Test__testSoftDeletesForceNullableDisabled__1.php
class ModelWithRelations (line 27) | class ModelWithRelations extends Model
method softDeletable (line 31) | public function softDeletable(): BelongsTo
method nonSoftDeletable (line 36) | public function nonSoftDeletable(): BelongsTo
method softDeletableHasOne (line 41) | public function softDeletableHasOne(): HasOne
method nonSoftDeletableHasOne (line 46) | public function nonSoftDeletableHasOne(): HasOne
class NonSoftDeletableModel (line 69) | class NonSoftDeletableModel extends Model
class SoftDeletableModel (line 96) | class SoftDeletableModel extends Model
FILE: tests/Console/ModelsCommand/SoftDeletesRelations/__snapshots__/Test__test__1.php
class ModelWithRelations (line 27) | class ModelWithRelations extends Model
method softDeletable (line 31) | public function softDeletable(): BelongsTo
method nonSoftDeletable (line 36) | public function nonSoftDeletable(): BelongsTo
method softDeletableHasOne (line 41) | public function softDeletableHasOne(): HasOne
method nonSoftDeletableHasOne (line 46) | public function nonSoftDeletableHasOne(): HasOne
class NonSoftDeletableModel (line 69) | class NonSoftDeletableModel extends Model
class SoftDeletableModel (line 96) | class SoftDeletableModel extends Model
FILE: tests/Console/ModelsCommand/UnionTypes/Models/UnionTypeModel.php
class UnionTypeModel (line 11) | class UnionTypeModel extends Model
method scopeWithUnionTypeParameter (line 13) | public function scopeWithUnionTypeParameter(Builder $query, string|int...
method scopeWithNullableUnionTypeParameter (line 18) | public function scopeWithNullableUnionTypeParameter(Builder $query, nu...
method withUnionTypeReturn (line 23) | public function withUnionTypeReturn(): HasMany|UnionTypeModel
method getFooAttribute (line 28) | public function getFooAttribute(): string|int|null
FILE: tests/Console/ModelsCommand/UnionTypes/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/UnionTypes/__snapshots__/Test__test__1.php
class UnionTypeModel (line 23) | class UnionTypeModel extends Model
method scopeWithUnionTypeParameter (line 25) | public function scopeWithUnionTypeParameter(Builder $query, string|int...
method scopeWithNullableUnionTypeParameter (line 30) | public function scopeWithNullableUnionTypeParameter(Builder $query, nu...
method withUnionTypeReturn (line 35) | public function withUnionTypeReturn(): HasMany|UnionTypeModel
method getFooAttribute (line 40) | public function getFooAttribute(): string|int|null
FILE: tests/Console/ModelsCommand/Variadic/Models/Simple.php
class Simple (line 10) | class Simple extends Model
method scopeWhereVariadic (line 12) | public function scopeWhereVariadic(Builder $query, ...$values): void
method scopeWhereTypedVariadic (line 16) | public function scopeWhereTypedVariadic(Builder $query, int ...$values...
FILE: tests/Console/ModelsCommand/Variadic/Test.php
class Test (line 10) | class Test extends AbstractModelsCommand
method test (line 12) | public function test(): void
FILE: tests/Console/ModelsCommand/Variadic/__snapshots__/Test__test__1.php
class Simple (line 20) | class Simple extends Model
method scopeWhereVariadic (line 22) | public function scopeWhereVariadic(Builder $query, ...$values): void
method scopeWhereTypedVariadic (line 26) | public function scopeWhereTypedVariadic(Builder $query, int ...$values...
FILE: tests/Console/ModelsCommand/migrations/____advanced_casts_table.php
class AdvancedCastsTable (line 9) | class AdvancedCastsTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/Console/ModelsCommand/migrations/____backed_attribute_table.php
class BackedAttributeTable (line 9) | class BackedAttributeTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/Console/ModelsCommand/migrations/____belongs_to_variation_table.php
class BelongsToVariationTable (line 9) | class BelongsToVariationTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/Console/ModelsCommand/migrations/____custom_casts_table.php
class CustomCastsTable (line 9) | class CustomCastsTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/Console/ModelsCommand/migrations/____custom_dates_table.php
class CustomDatesTable (line 9) | class CustomDatesTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/Console/ModelsCommand/migrations/____morphs_table.php
class MorphsTable (line 9) | class MorphsTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/Console/ModelsCommand/migrations/____posts_table.php
class PostsTable (line 9) | class PostsTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/Console/ModelsCommand/migrations/____simple_casts_table.php
class SimpleCastsTable (line 9) | class SimpleCastsTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/Console/ModelsCommand/migrations/____simple_table.php
class SimpleTable (line 9) | class SimpleTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/Console/ModelsCommand/migrations/____soft_deletes_relations_table.php
class SoftDeletesRelationsTable (line 9) | class SoftDeletesRelationsTable extends Migration
method up (line 11) | public function up(): void
FILE: tests/MacroTest.php
class MacroTest (line 25) | class MacroTest extends TestCase
method testInitPhpDocEloquentBuilderHasStaticInReturnType (line 31) | public function testInitPhpDocEloquentBuilderHasStaticInReturnType(): ...
method testInitPhpDocClosureWithoutDocBlock (line 54) | public function testInitPhpDocClosureWithoutDocBlock(): void
method testInitPhpDocClosureWithArgsAndReturnType (line 75) | public function testInitPhpDocClosureWithArgsAndReturnType(): void
method testInitPhpDocClosureWithArgs (line 99) | public function testInitPhpDocClosureWithArgs(): void
method testInitPhpDocClosureWithReturnType (line 123) | public function testInitPhpDocClosureWithReturnType(): void
method testInitPhpDocParamsAddedOnlyNotPresent (line 146) | public function testInitPhpDocParamsAddedOnlyNotPresent(): void
method testInitPhpDocReturnAddedOnlyNotPresent (line 170) | public function testInitPhpDocReturnAddedOnlyNotPresent(): void
method testInitPhpDocParamsWithUnionTypes (line 191) | public function testInitPhpDocParamsWithUnionTypes(): void
method testInitPhpDocParamsWithDnfTypes (line 210) | public function testInitPhpDocParamsWithDnfTypes(): void
method testInitPhpDocParamsWithPureIntersectionType (line 229) | public function testInitPhpDocParamsWithPureIntersectionType(): void
method testInitPhpDocParamsWithMultipleIntersections (line 248) | public function testInitPhpDocParamsWithMultipleIntersections(): void
method tagsToString (line 267) | protected function tagsToString(DocBlock $docBlock, string $name)
method testCanInstantiate (line 283) | public function testCanInstantiate()
method testOutput (line 295) | public function testOutput()
class MacroMock (line 325) | class MacroMock extends Macro
method __construct (line 327) | public function __construct()
method getPhpDoc (line 332) | public function getPhpDoc(ReflectionFunctionAbstract $method, ?Reflect...
class UrlGeneratorMacroClass (line 341) | class UrlGeneratorMacroClass
method __invoke (line 348) | public function __invoke(string $foo, int $bar = 0): string
FILE: tests/MethodTest.php
class MethodTest (line 12) | class MethodTest extends TestCase
method testCanInstantiate (line 17) | public function testCanInstantiate()
method testOutput (line 30) | public function testOutput()
method testEloquentBuilderOutput (line 58) | public function testEloquentBuilderOutput()
method testEloquentBuilderNormalizedReturnType (line 90) | public function testEloquentBuilderNormalizedReturnType()
method testQueryBuilderNormalizedReturnType (line 121) | public function testQueryBuilderNormalizedReturnType()
method testDefaultSpecialChars (line 152) | public function testDefaultSpecialChars()
method testClassAliases (line 167) | public function testClassAliases()
method testEloquentBuilderWithTemplates (line 193) | public function testEloquentBuilderWithTemplates()
class ExampleClass (line 217) | class ExampleClass
method setName (line 224) | public function setName($last, $first = 'Barry', ...$middle)
method setSpecialChars (line 229) | public function setSpecialChars($chars = "\$'\\")
method getApplication (line 237) | public function getApplication()
FILE: tests/RealTimeFacadesTest.php
class RealTimeFacadesTest (line 17) | class RealTimeFacadesTest extends TestCase
method testRealTimeFacades (line 19) | public function testRealTimeFacades()
method verifyNamespace (line 72) | private function verifyNamespace(Namespace_ $namespace, $target)
method getPackageProviders (line 86) | protected function getPackageProviders($app)
FILE: tests/SnapshotPhpDriver.php
class SnapshotPhpDriver (line 10) | class SnapshotPhpDriver implements Driver
method serialize (line 12) | public function serialize($data): string
method extension (line 17) | public function extension(): string
method match (line 22) | public function match($expected, $actual)
FILE: tests/SnapshotTxtDriver.php
class SnapshotTxtDriver (line 10) | class SnapshotTxtDriver implements Driver
method serialize (line 12) | public function serialize($data): string
method extension (line 17) | public function extension(): string
method match (line 22) | public function match($expected, $actual)
FILE: tests/TestCase.php
class TestCase (line 14) | abstract class TestCase extends BaseTestCase
method runCommand (line 34) | protected function runCommand(Command $command, array $arguments = [],...
method assertMatchesPhpSnapshot (line 48) | protected function assertMatchesPhpSnapshot(?string $actualContent)
method assertMatchesTxtSnapshot (line 53) | protected function assertMatchesTxtSnapshot(?string $actualContent)
method assertMatchesMockedSnapshot (line 58) | protected function assertMatchesMockedSnapshot()
method mockFilesystem (line 63) | protected function mockFilesystem()
FILE: tests/stubs/facade-0e0385307adf5db34c7986ecbd11646061356ec8.php
class Handler (line 12) | class Handler extends Facade
method getFacadeAccessor (line 17) | protected static function getFacadeAccessor(): string
FILE: tests/stubs/facade-9431b04ec1494fc71a1bc848f020044aba2af7b1.php
class Handler (line 12) | class Handler extends Facade
method getFacadeAccessor (line 17) | protected static function getFacadeAccessor(): string
Condensed preview — 286 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (822K chars).
[
{
"path": ".editorconfig",
"chars": 311,
"preview": "; This file is for unifying the coding style for different editors and IDEs.\n; More information at http://editorconfig.o"
},
{
"path": ".gitattributes",
"chars": 553,
"preview": "# Path-based git attributes\n# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html\n\n# Ignore all test and"
},
{
"path": ".github/FUNDING.yml",
"chars": 98,
"preview": "# These are supported funding model platforms\n\ngithub: barryvdh\ncustom: ['https://fruitcake.nl']\n\n"
},
{
"path": ".github/ISSUE_TEMPLATE/1_Bug_report.md",
"chars": 345,
"preview": "---\nname: \"🐛 Bug Report\"\nabout: 'Report a general bug.'\nlabels: bug\n\n---\n\n### Versions:\n- ide-helper Version: #.#.#\n- La"
},
{
"path": ".github/ISSUE_TEMPLATE/2_Feature_request.md",
"chars": 250,
"preview": "---\nname: \"✨ Feature request\"\nabout: 'Suggest a new feature or other improvements.'\nlabels: enhancement\n\n---\n\n### Summar"
},
{
"path": ".github/ISSUE_TEMPLATE/3_Support_question.md",
"chars": 266,
"preview": "---\nname: \"🙋🏼♂️ Support question\"\nabout: 'I need assistance or clarification on usage of this library.'\nlabels: questio"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 648,
"preview": "## Summary\n<!-- Please provide an exhaustive description. -->\n\n## Type of change\n\n<!-- Please delete options that are no"
},
{
"path": ".github/dependabot.yaml",
"chars": 171,
"preview": "version: 2\nupdates:\n - package-ecosystem: github-actions\n directory: /\n schedule:\n interval: monthly\n gro"
},
{
"path": ".github/release-drafter.yml",
"chars": 44,
"preview": "template: |\n ## What’s Changed\n\n $CHANGES\n"
},
{
"path": ".github/stale.yml",
"chars": 982,
"preview": "# Number of days of inactivity before an issue becomes stale\ndaysUntilStale: 90\n# Number of days of inactivity before a "
},
{
"path": ".github/workflows/composer-normalize.yml",
"chars": 711,
"preview": "name: normalize composer.json\n\non:\n push:\n paths:\n - .github/workflows/composer-normalize.yml\n - composer."
},
{
"path": ".github/workflows/fix-code-style.yml",
"chars": 738,
"preview": "name: Fix Code Style\n\non:\n push:\n\njobs:\n fix-style:\n name: Fix Code Style\n timeout-minutes: 15\n runs-on: ubun"
},
{
"path": ".github/workflows/release-drafter.yml",
"chars": 1404,
"preview": "name: Release Drafter\n\non:\n push:\n # branches to consider in the event; optional, defaults to all\n branches:\n "
},
{
"path": ".github/workflows/run-integration-tests.yml",
"chars": 1957,
"preview": "name: Integration Tests\n\non:\n push:\n branches:\n - master\n pull_request:\n branches:\n - \"*\"\n\njobs:\n php"
},
{
"path": ".github/workflows/run-static-analysis.yml",
"chars": 655,
"preview": "name: Run Static Analysis\n\non:\n push:\n pull_request:\n schedule:\n - cron: '0 0 * * *'\n\njobs:\n build:\n "
},
{
"path": ".github/workflows/run-tests.yml",
"chars": 1481,
"preview": "name: Tests\n\non:\n push:\n branches:\n - master\n pull_request:\n branches:\n - \"*\"\n\njobs:\n php-tests:\n "
},
{
"path": ".github/workflows/update-changelog.yaml",
"chars": 1022,
"preview": "name: \"Update Changelog\"\n\non:\n release:\n types: [released]\n\njobs:\n update:\n runs-on: ubuntu-latest\n\n permissi"
},
{
"path": ".gitignore",
"chars": 137,
"preview": ".phpunit.result.cache\n/auth.json\n/build\n/.idea\n/.php-cs-fixer.cache\n/.php-cs-fixer.php\n/.php-cs-fixer.tests.cache\n/compo"
},
{
"path": ".php-cs-fixer.common.php",
"chars": 1685,
"preview": "<?php\n\n// Share common rules between non-test and test files\nreturn [\n '@PSR12' => true,\n 'blank_line_after_openin"
},
{
"path": ".php-cs-fixer.dist.php",
"chars": 363,
"preview": "<?php\nrequire __DIR__ . '/vendor/autoload.php';\n\n$finder = PhpCsFixer\\Finder::create()\n ->in(__DIR__)\n ->exclude(["
},
{
"path": ".php-cs-fixer.tests.php",
"chars": 499,
"preview": "<?php\nrequire __DIR__ . '/vendor/autoload.php';\n\n$finder = PhpCsFixer\\Finder::create()\n ->in(__DIR__ . '/tests')\n "
},
{
"path": "CHANGELOG.md",
"chars": 33900,
"preview": "# Changelog\n\n## v3.7.0 - 2026-03-17\n\n### What's Changed\n\n* Skip calling fake() when required parameters exist (Socialite"
},
{
"path": "LICENSE.md",
"chars": 1133,
"preview": "# The MIT License (MIT)\n\nCopyright (c) Barry vd. Heuvel <barryvdh@gmail.com>\n\n> Permission is hereby granted, free of ch"
},
{
"path": "README.md",
"chars": 15370,
"preview": "# IDE Helper Generator for Laravel\n\n[\n\nCopyright (c) Taylor Otwell\n\nPermission is hereby granted, free of charge, to any person obtainin"
},
{
"path": "php-templates/README.md",
"chars": 189,
"preview": "The templates here are based on the official VS Code extension by Laravel https://github.com/laravel/vs-code-extension\n\n"
},
{
"path": "php-templates/auth.php",
"chars": 1547,
"preview": "<?php\n\nreturn collect(Illuminate\\Support\\Facades\\Gate::abilities())\n ->map(function ($policy, $key) {\n $reflec"
},
{
"path": "php-templates/configs.php",
"chars": 3312,
"preview": "<?php\n\n$local = collect(glob(config_path('/*.php')))\n ->merge(glob(config_path('**/*.php')))\n ->map(fn ($path) => "
},
{
"path": "php-templates/middleware.php",
"chars": 2103,
"preview": "<?php\n\nreturn collect(app(\"Illuminate\\Contracts\\Http\\Kernel\")->getMiddlewareGroups())\n ->merge(app(\"Illuminate\\Contra"
},
{
"path": "php-templates/routes.php",
"chars": 1564,
"preview": "<?php\n\nfunction vsCodeGetRouterReflection(Illuminate\\Routing\\Route $route)\n{\n if ($route->getActionName() === 'Closur"
},
{
"path": "php-templates/translations.php",
"chars": 4091,
"preview": "<?php\n\nfunction vsCodeGetTranslationsFromFile(Symfony\\Component\\Finder\\SplFileInfo $file, $path, $namespace)\n{\n if ($"
},
{
"path": "php-templates/views.php",
"chars": 1555,
"preview": "<?php\n\nfunction vsCodeFindBladeFiles($path)\n{\n $paths = [];\n\n if (!is_dir($path)) {\n return $paths;\n }\n\n"
},
{
"path": "phpstan-baseline.neon",
"chars": 2204,
"preview": "parameters:\n\tignoreErrors:\n\t\t-\n\t\t\tmessage: '#^File ends with a trailing whitespace\\. This may cause problems when runnin"
},
{
"path": "phpstan.neon",
"chars": 186,
"preview": "includes:\n - phpstan-baseline.neon\n - vendor/phpstan/phpstan-phpunit/extension.neon\n\nparameters:\n level: 2\n "
},
{
"path": "phpunit.xml.dist",
"chars": 506,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xs"
},
{
"path": "resources/views/helper.php",
"chars": 4742,
"preview": "<?= '<?php' ?>\n<?php\n/**\n * @var Barryvdh\\LaravelIdeHelper\\Alias[][] $namespaces_by_alias_ns\n * @var Barryvdh\\LaravelIde"
},
{
"path": "resources/views/meta.php",
"chars": 4341,
"preview": "<?= '<?php' ?>\n<?php\n/**\n * @var array $bindings\n * @var string[] $methods\n * @var string[] $configMethods\n * @var Illum"
},
{
"path": "src/Alias.php",
"chars": 17720,
"preview": "<?php\n\n/**\n * Laravel IDE Helper Generator\n *\n * @author Barry vd. Heuvel <barryvdh@gmail.com>\n * @copyright 2014 Bar"
},
{
"path": "src/Console/EloquentCommand.php",
"chars": 1369,
"preview": "<?php\n\n/**\n * Laravel IDE Helper Generator - Eloquent Model Mixin\n *\n * @author Charles A. Peterson <artistan@gmail.c"
},
{
"path": "src/Console/GeneratorCommand.php",
"chars": 5055,
"preview": "<?php\n\n/**\n * Laravel IDE Helper Generator\n *\n * @author Barry vd. Heuvel <barryvdh@gmail.com>\n * @copyright 2014 Bar"
},
{
"path": "src/Console/MetaCommand.php",
"chars": 12531,
"preview": "<?php\n\n/**\n * Laravel IDE Helper Generator\n *\n * @author Barry vd. Heuvel <barryvdh@gmail.com>\n * @copyright 2015 Bar"
},
{
"path": "src/Console/ModelsCommand.php",
"chars": 71187,
"preview": "<?php\n\n/**\n * Laravel IDE Helper Generator\n *\n * @author Barry vd. Heuvel <barryvdh@gmail.com>\n * @copyright 2014 Bar"
},
{
"path": "src/Contracts/ModelHookInterface.php",
"chars": 251,
"preview": "<?php\n\nnamespace Barryvdh\\LaravelIdeHelper\\Contracts;\n\nuse Barryvdh\\LaravelIdeHelper\\Console\\ModelsCommand;\nuse Illumina"
},
{
"path": "src/Eloquent.php",
"chars": 3374,
"preview": "<?php\n\n/**\n * Laravel IDE Helper to add \\Eloquent mixin to Eloquent\\Model\n *\n * @author Charles A. Peterson <artistan@gm"
},
{
"path": "src/Generator.php",
"chars": 13376,
"preview": "<?php\n\n/**\n * Laravel IDE Helper Generator\n *\n * @author Barry vd. Heuvel <barryvdh@gmail.com>\n * @copyright 2014 Bar"
},
{
"path": "src/IdeHelperServiceProvider.php",
"chars": 2657,
"preview": "<?php\n\n/**\n * Laravel IDE Helper Generator\n *\n * @author Barry vd. Heuvel <barryvdh@gmail.com>\n * @copyright 2014 Bar"
},
{
"path": "src/Listeners/GenerateModelHelper.php",
"chars": 1253,
"preview": "<?php\n\nnamespace Barryvdh\\LaravelIdeHelper\\Listeners;\n\nuse Illuminate\\Console\\Events\\CommandFinished;\nuse Illuminate\\Con"
},
{
"path": "src/Macro.php",
"chars": 5754,
"preview": "<?php\n\nnamespace Barryvdh\\LaravelIdeHelper;\n\nuse Barryvdh\\Reflection\\DocBlock;\nuse Barryvdh\\Reflection\\DocBlock\\Tag;\nuse"
},
{
"path": "src/Method.php",
"chars": 12040,
"preview": "<?php\n\n/**\n * Laravel IDE Helper Generator\n *\n * @author Barry vd. Heuvel <barryvdh@gmail.com>\n * @copyright 2014 Bar"
},
{
"path": "src/Parsers/PhpDocReturnTypeParser.php",
"chars": 1704,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Parsers;\n\nclass PhpDocReturnTypeParser\n{\n /**\n "
},
{
"path": "tests/AliasTest.php",
"chars": 3471,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests;\n\nuse Barryvdh\\LaravelIdeHelper\\Alias;\nuse Ba"
},
{
"path": "tests/Console/EloquentCommandTest.php",
"chars": 2327,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\EloquentCommand;\n\nuse Barryvdh\\Larave"
},
{
"path": "tests/Console/GeneratorCommand/AbstractGeneratorCommand.php",
"chars": 622,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\GeneratorCommand;\n\nuse Barryvdh\\Larav"
},
{
"path": "tests/Console/GeneratorCommand/GenerateEloquentOnly/Test.php",
"chars": 964,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\GeneratorCommand\\GenerateEloquentOnly"
},
{
"path": "tests/Console/GeneratorCommand/GenerateIdeHelper/Test.php",
"chars": 1801,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\GeneratorCommand\\GenerateIdeHelper;\n\n"
},
{
"path": "tests/Console/MetaCommand/MetaCommandTest.php",
"chars": 2683,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\MetaCommand;\n\nuse Barryvdh\\LaravelIde"
},
{
"path": "tests/Console/ModelsCommand/AbstractModelsCommand.php",
"chars": 1458,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand;\n\nuse Barryvdh\\LaravelI"
},
{
"path": "tests/Console/ModelsCommand/AdvancedCasts/Collections/AdvancedCastCollection.php",
"chars": 213,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\AdvancedCasts\\Collectio"
},
{
"path": "tests/Console/ModelsCommand/AdvancedCasts/Collections/AdvancedCastMap.php",
"chars": 414,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\AdvancedCasts\\Collectio"
},
{
"path": "tests/Console/ModelsCommand/AdvancedCasts/Enums/AdvancedCastEnum.php",
"chars": 195,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\AdvancedCasts\\Enums;\n\ne"
},
{
"path": "tests/Console/ModelsCommand/AdvancedCasts/Models/AdvancedCast.php",
"chars": 2160,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\AdvancedCasts\\Models;\n\n"
},
{
"path": "tests/Console/ModelsCommand/AdvancedCasts/Test.php",
"chars": 688,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\AdvancedCasts;\n\nuse Bar"
},
{
"path": "tests/Console/ModelsCommand/AdvancedCasts/__snapshots__/Test__test__1.php",
"chars": 5466,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\AdvancedCasts\\Models;\n\n"
},
{
"path": "tests/Console/ModelsCommand/AllowGlobDirectory/Services/Post/Models/Post.php",
"chars": 209,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\AllowGlobDirectory\\Serv"
},
{
"path": "tests/Console/ModelsCommand/AllowGlobDirectory/Test.php",
"chars": 1028,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\AllowGlobDirectory;\n\nus"
},
{
"path": "tests/Console/ModelsCommand/AllowGlobDirectory/__snapshots__/Test__test__1.php",
"chars": 10747,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\AllowGlobDirectory\\Serv"
},
{
"path": "tests/Console/ModelsCommand/ArrayCastsWithComment/Models/ArrayCastsWithComment.php",
"chars": 1573,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\ArrayCastsWithComment\\M"
},
{
"path": "tests/Console/ModelsCommand/ArrayCastsWithComment/Test.php",
"chars": 696,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\ArrayCastsWithComment;\n"
},
{
"path": "tests/Console/ModelsCommand/ArrayCastsWithComment/__snapshots__/Test__test__1.php",
"chars": 6047,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\ArrayCastsWithComment\\M"
},
{
"path": "tests/Console/ModelsCommand/Attributes/Models/BackedAttribute.php",
"chars": 1307,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Attributes\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/Attributes/Models/Simple.php",
"chars": 2805,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Attributes\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/Attributes/Test.php",
"chars": 685,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Attributes;\n\nuse Barryv"
},
{
"path": "tests/Console/ModelsCommand/Attributes/__snapshots__/Test__test__1.php",
"chars": 5827,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Attributes\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/Comment/Models/Simple.php",
"chars": 2606,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Comment\\Models;\n\nuse Il"
},
{
"path": "tests/Console/ModelsCommand/Comment/Test.php",
"chars": 682,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Comment;\n\nuse Barryvdh\\"
},
{
"path": "tests/Console/ModelsCommand/Comment/__snapshots__/Test__test__1.php",
"chars": 3978,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Comment\\Models;\n\nuse Il"
},
{
"path": "tests/Console/ModelsCommand/CustomCollection/Collections/SimpleCollection.php",
"chars": 220,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomCollection\\Collec"
},
{
"path": "tests/Console/ModelsCommand/CustomCollection/Models/Simple.php",
"chars": 570,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomCollection\\Models"
},
{
"path": "tests/Console/ModelsCommand/CustomCollection/Test.php",
"chars": 691,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomCollection;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/CustomCollection/__snapshots__/Test__test__1.php",
"chars": 1265,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomCollection\\Models"
},
{
"path": "tests/Console/ModelsCommand/CustomDate/Models/CustomDate.php",
"chars": 193,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomDate\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/CustomDate/Test.php",
"chars": 1016,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomDate;\n\nuse Barryv"
},
{
"path": "tests/Console/ModelsCommand/CustomDate/__snapshots__/Test__test__1.php",
"chars": 785,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomDate\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/CustomPhpdocTags/Models/Simple.php",
"chars": 462,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomPhpdocTags\\Models"
},
{
"path": "tests/Console/ModelsCommand/CustomPhpdocTags/Test.php",
"chars": 927,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomPhpdocTags;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/CustomPhpdocTags/__snapshots__/Test__testNoSpaceAfterCustomPhpdocTag__1.php",
"chars": 835,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\CustomPhpdocTags\\Models"
},
{
"path": "tests/Console/ModelsCommand/DnfTypes/Models/DnfTypeModel.php",
"chars": 6445,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DnfTypes\\Models;\n\nuse A"
},
{
"path": "tests/Console/ModelsCommand/DnfTypes/Test.php",
"chars": 683,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DnfTypes;\n\nuse Barryvdh"
},
{
"path": "tests/Console/ModelsCommand/DnfTypes/__snapshots__/Test__test__1.php",
"chars": 8031,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DnfTypes\\Models;\n\nuse A"
},
{
"path": "tests/Console/ModelsCommand/DoesNotGeneratePhpdocWithExternalEloquentBuilder/Builders/PostExternalQueryBuilder.php",
"chars": 408,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DoesNotGeneratePhpdocWi"
},
{
"path": "tests/Console/ModelsCommand/DoesNotGeneratePhpdocWithExternalEloquentBuilder/Models/Post.php",
"chars": 505,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DoesNotGeneratePhpdocWi"
},
{
"path": "tests/Console/ModelsCommand/DoesNotGeneratePhpdocWithExternalEloquentBuilder/Test.php",
"chars": 947,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DoesNotGeneratePhpdocWi"
},
{
"path": "tests/Console/ModelsCommand/DoesNotGeneratePhpdocWithExternalEloquentBuilder/__snapshots__/Test__test__1.php",
"chars": 11248,
"preview": "<?php\n\n// @formatter:off\n// phpcs:ignoreFile\n/**\n * A helper file for your Eloquent Models\n * Copy the phpDocs from this"
},
{
"path": "tests/Console/ModelsCommand/DynamicRelations/Models/Dynamic.php",
"chars": 1109,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DynamicRelations\\Models"
},
{
"path": "tests/Console/ModelsCommand/DynamicRelations/OtherModels/Account.php",
"chars": 201,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DynamicRelations\\OtherM"
},
{
"path": "tests/Console/ModelsCommand/DynamicRelations/Test.php",
"chars": 1450,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DynamicRelations;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/DynamicRelations/__snapshots__/Test__test__1.php",
"chars": 1581,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\DynamicRelations\\Models"
},
{
"path": "tests/Console/ModelsCommand/Factories/CustomSpace/ModelWithCustomNamespaceFactory.php",
"chars": 659,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Factories\\CustomSpace;\n"
},
{
"path": "tests/Console/ModelsCommand/Factories/Factories/ModelWithFactoryFactory.php",
"chars": 633,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Factories\\Factories;\n\nu"
},
{
"path": "tests/Console/ModelsCommand/Factories/Factories/ModelWithNestedFactoryFactory.php",
"chars": 651,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Factories\\Factories;\n\nu"
},
{
"path": "tests/Console/ModelsCommand/Factories/Models/ModelWithCustomNamespace.php",
"chars": 643,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Factories\\Models;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/Factories/Models/ModelWithFactory.php",
"chars": 273,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Factories\\Models;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/Factories/Models/ModelWithNestedFactory.php",
"chars": 174,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Factories\\Models;\n\nclas"
},
{
"path": "tests/Console/ModelsCommand/Factories/Models/ModelWithoutFactory.php",
"chars": 276,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Factories\\Models;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/Factories/Test.php",
"chars": 1625,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Factories;\n\nuse Barryvd"
},
{
"path": "tests/Console/ModelsCommand/Factories/__snapshots__/Test__testFactory__1.php",
"chars": 3116,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Factories\\Models;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpDocWithEnumDefaults/Enums/PostStatus.php",
"chars": 224,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpDocWith"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpDocWithEnumDefaults/Models/Post.php",
"chars": 485,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpDocWith"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpDocWithEnumDefaults/Test.php",
"chars": 710,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpDocWith"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpDocWithEnumDefaults/__snapshots__/Test__test__1.php",
"chars": 9091,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpDocWith"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdoc/Models/Post.php",
"chars": 196,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdoc\\Mod"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdoc/Test.php",
"chars": 839,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdoc;\n\nu"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdoc/__snapshots__/Test__test__1.php",
"chars": 10734,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdoc\\Mod"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdocCamel/Models/Post.php",
"chars": 201,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdocCame"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdocCamel/Test.php",
"chars": 882,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdocCame"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdocCamel/__snapshots__/Test__test__1.php",
"chars": 10605,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdocCame"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdocFinal/Models/Post.php",
"chars": 207,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdocFina"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdocFinal/Test.php",
"chars": 699,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdocFina"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdocFinal/__snapshots__/Test__test__1.php",
"chars": 10745,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdocFina"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdocWithEloquentHelper/Models/Post.php",
"chars": 214,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdocWith"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdocWithEloquentHelper/Test.php",
"chars": 1033,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdocWith"
},
{
"path": "tests/Console/ModelsCommand/GenerateBasicPhpdocWithEloquentHelper/__snapshots__/Test__test__1.php",
"chars": 10757,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateBasicPhpdocWith"
},
{
"path": "tests/Console/ModelsCommand/GenerateMixinCollection/Models/WithCollection.php",
"chars": 1362,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateMixinCollection"
},
{
"path": "tests/Console/ModelsCommand/GenerateMixinCollection/NonModels/CollectionModel.php",
"chars": 159,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateMixinCollection"
},
{
"path": "tests/Console/ModelsCommand/GenerateMixinCollection/NonModels/NonModel.php",
"chars": 152,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateMixinCollection"
},
{
"path": "tests/Console/ModelsCommand/GenerateMixinCollection/Test.php",
"chars": 704,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateMixinCollection"
},
{
"path": "tests/Console/ModelsCommand/GenerateMixinCollection/__snapshots__/Test__test__1.php",
"chars": 3020,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenerateMixinCollection"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpDocWithTypedScopeParameter/Models/Comment.php",
"chars": 6718,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpDocWithTyped"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpDocWithTypedScopeParameter/Test.php",
"chars": 712,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpDocWithTyped"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpDocWithTypedScopeParameter/__snapshots__/Test__test__1.php",
"chars": 10787,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpDocWithTyped"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilder/Builders/PostExternalQueryBuilder.php",
"chars": 2109,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithExter"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilder/Models/Post.php",
"chars": 491,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithExter"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilder/Test.php",
"chars": 747,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithExter"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilder/__snapshots__/Test__test__1.php",
"chars": 20685,
"preview": "<?php\n\n// @formatter:off\n// phpcs:ignoreFile\n/**\n * A helper file for your Eloquent Models\n * Copy the phpDocs from this"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilderWithFqn/Builders/PostExternalQueryBuilder.php",
"chars": 2116,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithExter"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilderWithFqn/Models/Post.php",
"chars": 505,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithExter"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilderWithFqn/Test.php",
"chars": 723,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithExter"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithExternalEloquentBuilderWithFqn/__snapshots__/Test__test__1.php",
"chars": 11459,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithExter"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithForcedFqn/Models/Post.php",
"chars": 512,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithForce"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithForcedFqn/Test.php",
"chars": 867,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithForce"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithForcedFqn/__snapshots__/Test__test__1.php",
"chars": 18690,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithForce"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithFqn/Casts/CastType.php",
"chars": 152,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithFqn\\C"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithFqn/Models/Post.php",
"chars": 1195,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithFqn\\M"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithFqn/Test.php",
"chars": 696,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithFqn;\n"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithFqn/__snapshots__/Test__test__1.php",
"chars": 10478,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithFqn\\M"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithFqnInExternalFile/Builders/EMaterialQueryBuilder.php",
"chars": 235,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithFqnIn"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithFqnInExternalFile/Models/Post.php",
"chars": 470,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithFqnIn"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithFqnInExternalFile/Test.php",
"chars": 741,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithFqnIn"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithFqnInExternalFile/__snapshots__/Test__test__1.php",
"chars": 17151,
"preview": "<?php\n\n// @formatter:off\n// phpcs:ignoreFile\n/**\n * A helper file for your Eloquent Models\n * Copy the phpDocs from this"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models/FinalPost.php",
"chars": 304,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithMixin"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Models/Post.php",
"chars": 293,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithMixin"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithMixin/Test.php",
"chars": 704,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithMixin"
},
{
"path": "tests/Console/ModelsCommand/GeneratePhpdocWithMixin/__snapshots__/Test__test__1.php",
"chars": 12133,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GeneratePhpdocWithMixin"
},
{
"path": "tests/Console/ModelsCommand/GenericsSyntaxDisabled/Models/Simple.php",
"chars": 563,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenericsSyntaxDisabled\\"
},
{
"path": "tests/Console/ModelsCommand/GenericsSyntaxDisabled/Test.php",
"chars": 878,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenericsSyntaxDisabled;"
},
{
"path": "tests/Console/ModelsCommand/GenericsSyntaxDisabled/__snapshots__/Test__test__1.php",
"chars": 1343,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\GenericsSyntaxDisabled\\"
},
{
"path": "tests/Console/ModelsCommand/Getter/Models/Simple.php",
"chars": 2139,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Getter\\Models;\n\nuse Dat"
},
{
"path": "tests/Console/ModelsCommand/Getter/Test.php",
"chars": 681,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Getter;\n\nuse Barryvdh\\L"
},
{
"path": "tests/Console/ModelsCommand/Getter/__snapshots__/Test__test__1.php",
"chars": 3734,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Getter\\Models;\n\nuse Dat"
},
{
"path": "tests/Console/ModelsCommand/Ignored/Models/Ignored.php",
"chars": 187,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Ignored\\Models;\n\nuse Il"
},
{
"path": "tests/Console/ModelsCommand/Ignored/Models/NotIgnored.php",
"chars": 190,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Ignored\\Models;\n\nuse Il"
},
{
"path": "tests/Console/ModelsCommand/Ignored/Test.php",
"chars": 969,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Ignored;\n\nuse Barryvdh\\"
},
{
"path": "tests/Console/ModelsCommand/Ignored/__snapshots__/Test__test__1.php",
"chars": 478,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Ignored\\Models;\n\nuse Il"
},
{
"path": "tests/Console/ModelsCommand/Interfaces/Models/User.php",
"chars": 1032,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Interfaces\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/Interfaces/Test.php",
"chars": 722,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\Interfaces;\n\nuse Barryv"
},
{
"path": "tests/Console/ModelsCommand/Interfaces/__snapshots__/Test__test__1.php",
"chars": 696,
"preview": "<?php\n\n// @formatter:off\n// phpcs:ignoreFile\n/**\n * A helper file for your Eloquent Models\n * Copy the phpDocs from this"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableReturnsAnonymousCaster.php",
"chars": 901,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableReturnsCustomCaster.php",
"chars": 357,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableWithoutReturnType.php",
"chars": 740,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastedProperty.php",
"chars": 149,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithDocblockReturn.php",
"chars": 600,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithDocblockReturnFqn.php",
"chars": 603,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithNullablePrimitiveReturn.php",
"chars": 609,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithParam.php",
"chars": 567,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithPrimitiveDocblockReturn.php",
"chars": 605,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithPrimitiveReturn.php",
"chars": 600,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithReturnType.php",
"chars": 584,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithStaticReturnType.php",
"chars": 585,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithoutReturnType.php",
"chars": 534,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithStaticDocblockReturn.php",
"chars": 234,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithThisDocblockReturn.php",
"chars": 232,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/InboundAttributeCaster.php",
"chars": 384,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/SelfCastingCasterWithStaticDocblockReturn.php",
"chars": 576,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Casts/SelfCastingCasterWithThisDocblockReturn.php",
"chars": 573,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Cast"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Models/CustomCast.php",
"chars": 4165,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Mode"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/Test.php",
"chars": 693,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts;\n\nus"
},
{
"path": "tests/Console/ModelsCommand/LaravelCustomCasts/__snapshots__/Test__test__1.php",
"chars": 8287,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\LaravelCustomCasts\\Mode"
},
{
"path": "tests/Console/ModelsCommand/MagicWhere/Models/Post.php",
"chars": 187,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\MagicWhere\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/MagicWhere/Test.php",
"chars": 865,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\MagicWhere;\n\nuse Barryv"
},
{
"path": "tests/Console/ModelsCommand/MagicWhere/__snapshots__/Test__test__1.php",
"chars": 3564,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\MagicWhere\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/ModelHooks/Hooks/CustomMethod.php",
"chars": 546,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\ModelHooks\\Hooks;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/ModelHooks/Hooks/CustomProperty.php",
"chars": 469,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\ModelHooks\\Hooks;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/ModelHooks/Hooks/UnsetMethod.php",
"chars": 450,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\ModelHooks\\Hooks;\n\nuse "
},
{
"path": "tests/Console/ModelsCommand/ModelHooks/Models/Simple.php",
"chars": 189,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\ModelHooks\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/ModelHooks/Test.php",
"chars": 1535,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\ModelHooks;\n\nuse Barryv"
},
{
"path": "tests/Console/ModelsCommand/ModelHooks/__snapshots__/Test__test__1.php",
"chars": 606,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\ModelHooks\\Models;\n\nuse"
},
{
"path": "tests/Console/ModelsCommand/MorphToIntersection/Models/BaseModel.php",
"chars": 210,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\MorphToIntersection\\Mod"
},
{
"path": "tests/Console/ModelsCommand/MorphToIntersection/Models/CanBeAssigned.php",
"chars": 154,
"preview": "<?php\n\ndeclare(strict_types=1);\n\nnamespace Barryvdh\\LaravelIdeHelper\\Tests\\Console\\ModelsCommand\\MorphToIntersection\\Mod"
}
]
// ... and 86 more files (download for full content)
About this extraction
This page contains the full source code of the barryvdh/laravel-ide-helper GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 286 files (745.3 KB), approximately 183.6k tokens, and a symbol index with 1034 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.