Skip to content

add support for on, onWriteConnection, with on models #1260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
- Use platformName to determine db type when casting boolean types [\#1212 / stockalexander](https://github.com/barryvdh/laravel-ide-helper/pull/1212)

### Added
- Add `on`, `onWriteConnection` and `with` to models [\#1260 / douglasdc3](https://github.com/barryvdh/laravel-ide-helper/pull/1260)
- Add support of variadic parameters in `ide-helper:models` [\#1234 / shaffe-fr](https://github.com/barryvdh/laravel-ide-helper/pull/1234)

### Changed
7 changes: 5 additions & 2 deletions src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
@@ -588,12 +588,15 @@ public function getPropertiesFromMethods($model)
);
$this->setMethod($name, $builder . '|' . $modelName, $args, $comment);
}
} elseif (in_array($method, ['query', 'newQuery', 'newModelQuery'])) {
} elseif (in_array($method, ['query', 'newQuery', 'newModelQuery', 'on', 'onWriteConnection', 'with'])) {
$builder = $this->getClassNameInDestinationFile($model, get_class($model->newModelQuery()));

$reflection = new \ReflectionMethod($model, $method);

$this->setMethod(
$method,
$builder . '|' . $this->getClassNameInDestinationFile($model, get_class($model))
$builder . '|' . $this->getClassNameInDestinationFile($model, get_class($model)),
$this->getParameters($reflection)
);

if ($this->write_model_external_builder_methods) {
Original file line number Diff line number Diff line change
@@ -84,6 +84,8 @@
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|Post newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Post onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Post query()
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNullable($value)
@@ -158,6 +160,7 @@
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUuidNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post with($relations)
* @mixin \Eloquent
*/
class Post extends Model
Original file line number Diff line number Diff line change
@@ -29,8 +29,11 @@
* @method static \Illuminate\Database\Eloquent\Builder|Simple active() Scope a query to only include active users.
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model
Original file line number Diff line number Diff line change
@@ -18,8 +18,11 @@
* @method static SimpleCollection|static[] get($columns = ['*'])
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model
Original file line number Diff line number Diff line change
@@ -13,9 +13,12 @@
* @property \Carbon\CarbonImmutable|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|CustomDate newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CustomDate newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CustomDate on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|CustomDate onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|CustomDate query()
* @method static \Illuminate\Database\Eloquent\Builder|CustomDate whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CustomDate whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CustomDate with($relations)
* @mixin \Eloquent
*/
class CustomDate extends Model
Original file line number Diff line number Diff line change
@@ -89,6 +89,8 @@
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DoesNotGeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post newModelQuery()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DoesNotGeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post newQuery()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DoesNotGeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post on($connection = null)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DoesNotGeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post onWriteConnection()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DoesNotGeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post query()
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNullable($value)
@@ -163,6 +165,7 @@
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUuidNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNullable($value)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DoesNotGeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post with($relations)
*/
class Post extends \Eloquent {}
}
Original file line number Diff line number Diff line change
@@ -16,7 +16,10 @@
* @property-read int|null $regular_has_many_count
* @method static \Illuminate\Database\Eloquent\Builder|Dynamic newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Dynamic newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Dynamic on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Dynamic onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Dynamic query()
* @method static \Illuminate\Database\Eloquent\Builder|Dynamic with($relations)
* @mixin \Eloquent
*/
class Dynamic extends Model
Original file line number Diff line number Diff line change
@@ -14,7 +14,10 @@
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\CustomSpace\ModelWithCustomNamespaceFactory factory(...$parameters)
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithCustomNamespace newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithCustomNamespace newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithCustomNamespace on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithCustomNamespace onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithCustomNamespace query()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithCustomNamespace with($relations)
* @mixin \Eloquent
*/
class ModelWithCustomNamespace extends Model
@@ -46,7 +49,10 @@ protected static function newFactory()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Factories\ModelWithFactoryFactory factory(...$parameters)
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithFactory newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithFactory newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithFactory on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithFactory onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithFactory query()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithFactory with($relations)
* @mixin \Eloquent
*/
class ModelWithFactory extends Model
@@ -65,7 +71,10 @@ class ModelWithFactory extends Model
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Factories\ModelWithNestedFactoryFactory factory(...$parameters)
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithNestedFactory newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithNestedFactory newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithNestedFactory on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithNestedFactory onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithNestedFactory query()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithNestedFactory with($relations)
* @mixin \Eloquent
*/
class ModelWithNestedFactory extends ModelWithFactory
@@ -85,7 +94,10 @@ class ModelWithNestedFactory extends ModelWithFactory
*
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithoutFactory newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithoutFactory newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithoutFactory on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithoutFactory onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithoutFactory query()
* @method static \Illuminate\Database\Eloquent\Builder|ModelWithoutFactory with($relations)
* @mixin \Eloquent
*/
class ModelWithoutFactory extends Model
Original file line number Diff line number Diff line change
@@ -84,6 +84,8 @@
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|Post newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Post onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Post query()
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNullable($value)
@@ -158,6 +160,7 @@
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUuidNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post with($relations)
* @mixin \Eloquent
*/
class Post extends Model
Original file line number Diff line number Diff line change
@@ -84,6 +84,8 @@
* @property \Illuminate\Support\Carbon|null $updatedAt
* @method static \Illuminate\Database\Eloquent\Builder|Post newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Post onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Post query()
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNullable($value)
@@ -158,6 +160,7 @@
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUuidNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post with($relations)
* @mixin \Eloquent
*/
class Post extends Model
Original file line number Diff line number Diff line change
@@ -84,6 +84,8 @@
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|Post newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Post onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Post query()
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNullable($value)
@@ -158,6 +160,7 @@
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUuidNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post with($relations)
* @mixin \Eloquent
*/
final class Post extends Model
Original file line number Diff line number Diff line change
@@ -92,6 +92,8 @@
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post isStatus(string $status)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post newModelQuery()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post newQuery()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post on($connection = null)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post onWriteConnection()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post query()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post whereBigIntegerNotNullable($value)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post whereBigIntegerNullable($value)
@@ -166,6 +168,7 @@
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post whereUuidNullable($value)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post whereYearNotNullable($value)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post whereYearNullable($value)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post with($relations)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post withBool(?bool $booleanVar)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post withBoolDifferently(?bool $booleanVar)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Builders\PostExternalQueryBuilder|Post withBoolTypeHinted(bool $booleanVar)
Original file line number Diff line number Diff line change
@@ -88,6 +88,8 @@
* @method static PostExternalQueryBuilder|Post isStatus(string $status)
* @method static PostExternalQueryBuilder|Post newModelQuery()
* @method static PostExternalQueryBuilder|Post newQuery()
* @method static PostExternalQueryBuilder|Post on($connection = null)
* @method static PostExternalQueryBuilder|Post onWriteConnection()
* @method static PostExternalQueryBuilder|Post query()
* @method static PostExternalQueryBuilder|Post whereBigIntegerNotNullable($value)
* @method static PostExternalQueryBuilder|Post whereBigIntegerNullable($value)
@@ -162,6 +164,7 @@
* @method static PostExternalQueryBuilder|Post whereUuidNullable($value)
* @method static PostExternalQueryBuilder|Post whereYearNotNullable($value)
* @method static PostExternalQueryBuilder|Post whereYearNullable($value)
* @method static PostExternalQueryBuilder|Post with($relations)
* @method static PostExternalQueryBuilder|Post withBool(?bool $booleanVar)
* @method static PostExternalQueryBuilder|Post withBoolDifferently(?bool $booleanVar)
* @method static PostExternalQueryBuilder|Post withBoolTypeHinted(bool $booleanVar)
Original file line number Diff line number Diff line change
@@ -89,6 +89,8 @@
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post null(string $unusedParam)
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post onWriteConnection()
* @method static \Illuminate\Database\Query\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post query()
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post whereBigIntegerNotNullable($value)
@@ -164,6 +166,7 @@
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post whereUuidNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post whereYearNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post whereYearNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post with($relations)
* @method static \Illuminate\Database\Query\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post withTrashed()
* @method static \Illuminate\Database\Query\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post withoutTrashed()
* @mixin \Eloquent
Original file line number Diff line number Diff line change
@@ -95,6 +95,8 @@
* @method static EloquentBuilder|Post newModelQuery()
* @method static EloquentBuilder|Post newQuery()
* @method static EloquentBuilder|Post null(string $unusedParam)
* @method static EloquentBuilder|Post on($connection = null)
* @method static EloquentBuilder|Post onWriteConnection()
* @method static QueryBuilder|Post onlyTrashed()
* @method static EloquentBuilder|Post query()
* @method static EloquentBuilder|Post whereBigIntegerNotNullable($value)
@@ -170,6 +172,7 @@
* @method static EloquentBuilder|Post whereUuidNullable($value)
* @method static EloquentBuilder|Post whereYearNotNullable($value)
* @method static EloquentBuilder|Post whereYearNullable($value)
* @method static EloquentBuilder|Post with($relations)
* @method static QueryBuilder|Post withTrashed()
* @method static QueryBuilder|Post withoutTrashed()
* @mixin Eloquent
Original file line number Diff line number Diff line change
@@ -89,6 +89,8 @@
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post newModelQuery()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post newQuery()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post on($connection = null)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post onWriteConnection()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post query()
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post whereBigIntegerNotNullable($value)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post whereBigIntegerNullable($value)
@@ -163,6 +165,7 @@
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post whereUuidNullable($value)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post whereYearNotNullable($value)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post whereYearNullable($value)
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders\EMaterialQueryBuilder|Post with($relations)
*/
class Post extends \Eloquent {}
}
Original file line number Diff line number Diff line change
@@ -107,6 +107,8 @@ class Post extends Model
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|Post newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Post onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Post query()
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNullable($value)
@@ -181,6 +183,7 @@ class Post extends Model
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUuidNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post with($relations)
* @mixin \Eloquent
*/
class IdeHelperPost extends \Eloquent {}
Original file line number Diff line number Diff line change
@@ -33,8 +33,11 @@
* @property-read mixed $attribute_without_type
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model
Original file line number Diff line number Diff line change
@@ -11,7 +11,10 @@
*
* @method static \Illuminate\Database\Eloquent\Builder|NotIgnored newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|NotIgnored newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|NotIgnored on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|NotIgnored onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|NotIgnored query()
* @method static \Illuminate\Database\Eloquent\Builder|NotIgnored with($relations)
* @mixin \Eloquent
*/
class NotIgnored extends Model
Original file line number Diff line number Diff line change
@@ -16,7 +16,10 @@
*
* @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|User newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|User on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|User onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|User query()
* @method static \Illuminate\Database\Eloquent\Builder|User with($relations)
*/
class User extends \Eloquent implements \Illuminate\Contracts\Auth\Authenticatable {}
}
Original file line number Diff line number Diff line change
@@ -36,6 +36,8 @@
* @property SelfCastingCasterWithStaticDocblockReturn $casted_property_with_static_return_docblock_and_param
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast query()
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast whereCastedPropertyWithParam($value)
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast whereCastedPropertyWithReturnDocblock($value)
@@ -50,6 +52,7 @@
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast whereCastedPropertyWithoutReturn($value)
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast whereExtendedCastedPropertyWithStaticReturnDocblock($value)
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast whereExtendedCastedPropertyWithThisReturnDocblock($value)
* @method static \Illuminate\Database\Eloquent\Builder|CustomCast with($relations)
* @mixin \Eloquent
*/
class CustomCast extends Model
Original file line number Diff line number Diff line change
@@ -84,7 +84,10 @@
* @property \Illuminate\Support\Carbon|null $updated_at
* @method static \Illuminate\Database\Eloquent\Builder|Post newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Post onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Post query()
* @method static \Illuminate\Database\Eloquent\Builder|Post with($relations)
* @mixin \Eloquent
*/
class Post extends Model
3 changes: 3 additions & 0 deletions tests/Console/ModelsCommand/ModelHooks/Test.php
Original file line number Diff line number Diff line change
@@ -78,7 +78,10 @@ public function test(): void
* @method static \Illuminate\Database\Eloquent\Builder|Simple custom($custom)
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model
Original file line number Diff line number Diff line change
@@ -12,8 +12,11 @@
* @property integer $id
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model
Original file line number Diff line number Diff line change
@@ -12,8 +12,11 @@
* @property integer $id
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
* @noinspection PhpFullyQualifiedNameUsageInspection
* @noinspection PhpUnnecessaryFullyQualifiedNameInspection
Original file line number Diff line number Diff line change
@@ -86,6 +86,8 @@
* @property-read \Illuminate\Database\Eloquent\Collection|Post[] $relationHasMany
* @method static \Illuminate\Database\Eloquent\Builder|Post newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Post on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Post onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Post query()
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereBigIntegerNullable($value)
@@ -160,6 +162,7 @@
* @method static \Illuminate\Database\Eloquent\Builder|Post whereUuidNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNotNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post whereYearNullable($value)
* @method static \Illuminate\Database\Eloquent\Builder|Post with($relations)
* @mixin \Eloquent
*/
class Post extends Model
Original file line number Diff line number Diff line change
@@ -21,12 +21,15 @@
* @property-read BelongsToVariation|null $nullableColumnWithNoForeignKeyConstraint
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation query()
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereNotNullColumnWithForeignKeyConstraint($value)
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereNotNullColumnWithNoForeignKeyConstraint($value)
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereNullableColumnWithForeignKeyConstraint($value)
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereNullableColumnWithNoForeignKeyConstraint($value)
* @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation with($relations)
* @mixin \Eloquent
*/
class BelongsToVariation extends Model
@@ -97,8 +100,11 @@ public function nullableColumnWithNoForeignKeyConstraint(): BelongsTo
* @property-read Simple $relationSampleToManyRelationType
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model
Original file line number Diff line number Diff line change
@@ -13,8 +13,11 @@
* @property integer $id
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model
Original file line number Diff line number Diff line change
@@ -12,8 +12,11 @@
* @property integer $id
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model
Original file line number Diff line number Diff line change
@@ -12,8 +12,11 @@
* @property integer $id
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model
Original file line number Diff line number Diff line change
@@ -13,9 +13,12 @@
* @property integer $id
* @method static \Illuminate\Database\Eloquent\Builder|Simple newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Simple on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|Simple onWriteConnection()
* @method static \Illuminate\Database\Query\Builder|Simple onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|Simple query()
* @method static \Illuminate\Database\Eloquent\Builder|Simple whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Simple with($relations)
* @method static \Illuminate\Database\Query\Builder|Simple withTrashed()
* @method static \Illuminate\Database\Query\Builder|Simple withoutTrashed()
* @mixin \Eloquent
Original file line number Diff line number Diff line change
@@ -16,7 +16,10 @@
* @property-read int|null $with_union_type_return_count
* @method static \Illuminate\Database\Eloquent\Builder|UnionTypeModel newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|UnionTypeModel newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|UnionTypeModel on($connection = null)
* @method static \Illuminate\Database\Eloquent\Builder|UnionTypeModel onWriteConnection()
* @method static \Illuminate\Database\Eloquent\Builder|UnionTypeModel query()
* @method static \Illuminate\Database\Eloquent\Builder|UnionTypeModel with($relations)
* @method static \Illuminate\Database\Eloquent\Builder|UnionTypeModel withNullableUnionTypeParameter(string|int|null $bar)
* @method static \Illuminate\Database\Eloquent\Builder|UnionTypeModel withUnionTypeParameter(string|int $bar)
* @mixin \Eloquent
Original file line number Diff line number Diff line change
@@ -13,10 +13,13 @@
* @property integer $id
* @method static Builder|Simple newModelQuery()
* @method static Builder|Simple newQuery()
* @method static Builder|Simple on($connection = null)
* @method static Builder|Simple onWriteConnection()
* @method static Builder|Simple query()
* @method static Builder|Simple whereId($value)
* @method static Builder|Simple whereTypedVariadic(int ...$values)
* @method static Builder|Simple whereVariadic(...$values)
* @method static Builder|Simple with($relations)
* @mixin \Eloquent
*/
class Simple extends Model